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:45 +0000 Subject: [PATCH] Add isShrink to EntityResurrectEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 864ab97b7a6c62c376ca38dbbc65bc9406dfd62b..5d44d0530adac1efcbe2d3cf2b581c2cbfeee43e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1549,12 +1549,12 @@ public abstract class LivingEntity extends Entity { } org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null; - EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); + EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot, true); event.setCancelled(itemstack == null); this.level.getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - if (!itemstack1.isEmpty()) { + if (!itemstack1.isEmpty() && event.isShrink()) { itemstack1.shrink(1); } if (itemstack != null && this instanceof ServerPlayer) { @@ -4433,3 +4433,4 @@ public abstract class LivingEntity extends Entity { } } +