From 76326aa5f8d3fe38a06f026759bdcf5d0a6f662a Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 4 Jul 2024 20:48:21 +1000 Subject: [PATCH] SPIGOT-7814: Call PlayerShearEntityEvent for Bogged By: Doc --- .../minecraft/world/entity/monster/Bogged.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 paper-server/nms-patches/net/minecraft/world/entity/monster/Bogged.patch diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/Bogged.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/Bogged.patch new file mode 100644 index 0000000000..05fc9bf8c8 --- /dev/null +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/Bogged.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/world/entity/monster/Bogged.java ++++ b/net/minecraft/world/entity/monster/Bogged.java +@@ -79,6 +79,12 @@ + ItemStack itemstack = entityhuman.getItemInHand(enumhand); + + if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { ++ // CraftBukkit start ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) { ++ this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients ++ return EnumInteractionResult.PASS; ++ } ++ // CraftBukkit end + this.shear(SoundCategory.PLAYERS); + this.gameEvent(GameEvent.SHEAR, entityhuman); + if (!this.level().isClientSide) {