9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-api/paper-patches/features/0002-Add-isShrink-to-EntityResurrectEvent.patch
Lumine1909 f09fbb247d 1.21.5 (#470)
---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Fortern <blueten.ki@gmail.com>
Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
2025-06-05 18:41:51 +08:00

61 lines
2.0 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 fa60c0ce5c79757952ad39932e1c5fac8b068811..71fd070aaebfd9fa0fbfd6eb7cd26c8b34120203 100644
--- a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
@@ -17,22 +17,46 @@ public class EntityResurrectEvent extends EntityEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
- private final EquipmentSlot hand;
-
private boolean cancelled;
+ private boolean shrink;
+
+ private final EquipmentSlot hand;
@ApiStatus.Internal
- public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand) {
+ public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand, boolean shrink) {
super(livingEntity);
+ this.shrink = shrink;
this.hand = hand;
}
+ public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand) {
+ this(livingEntity, hand, true);
+ }
+
@ApiStatus.Internal
@Deprecated(since = "1.19.2", forRemoval = true)
public EntityResurrectEvent(@NotNull LivingEntity livingEntity) {
this(livingEntity, null);
}
+ /**
+ * 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
@Override
public LivingEntity getEntity() {