9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-20 07:19:35 +00:00
Files
LeavesMC/patches/api/0002-Add-isShrink-to-EntityResurrectEvent.patch
2022-10-08 07:55:51 +08:00

58 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Wed, 30 Mar 2022 08:58:32 +0000
Subject: [PATCH] Add isShrink to EntityResurrectEvent
diff --git a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
index 2f6ad5c2fc7ae7cf22cb424df3543c24f3ee6ebe..379237368070555890f07e71b003d2c42d8ab2b0 100644
--- a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
@@ -15,19 +15,43 @@ import org.jetbrains.annotations.Nullable;
public class EntityResurrectEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
- //
+
private boolean cancelled;
+ private boolean shrink;
private final EquipmentSlot hand;
- public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand) {
+ public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand, boolean shrink) {
super(what);
+ this.shrink = shrink;
this.hand = hand;
}
+ public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand) {
+ this(what, hand, true);
+ }
+
@Deprecated
public EntityResurrectEvent(@NotNull LivingEntity what) {
- this(what, null);
+ this(what, null, true);
+ }
+
+ /**
+ * Get is shrink item
+ *
+ * @return is shrink item
+ */
+ public boolean isShrink() {
+ return shrink;
+ }
+
+ /**
+ * Set is shrink item
+ *
+ * @param shrink is shrink item
+ */
+ public void setShrink(boolean shrink) {
+ this.shrink = shrink;
}
@NotNull