diff --git a/patches/server/Add-drops-to-shear-events.patch b/patches/server/Add-drops-to-shear-events.patch index 07752d4eed..5ab5974b57 100644 --- a/patches/server/Add-drops-to-shear-events.patch +++ b/patches/server/Add-drops-to-shear-events.patch @@ -257,7 +257,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); + if (event != null) { + if (event.isCancelled()) { -+ this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients ++ // this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients // Paper - no longer needed + return InteractionResult.PASS; + } + drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops()); @@ -296,15 +296,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - private void spawnShearedMushrooms(ServerLevel world, ItemStack shears) { -- this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> { + // Paper start - custom shear drops + private void spawnShearedMushrooms(ServerLevel world, ItemStack shears, java.util.List drops) { + final ServerLevel worldserver1 = world; // Named for lambda consumption + this.forceDrops = true; // Paper - Add missing forceDrop toggles +- this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> { + drops.forEach(itemstack1 -> { + // Paper end - custom shear drops this.spawnAtLocation(worldserver1, itemstack1, this.getBbHeight()); }); - } + this.forceDrops = false; // Paper - Add missing forceDrop toggles diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/patches/server/Add-missing-forceDrop-toggles.patch b/patches/server/Add-missing-forceDrop-toggles.patch index 07077e8fd8..28ac750cbd 100644 --- a/patches/server/Add-missing-forceDrop-toggles.patch +++ b/patches/server/Add-missing-forceDrop-toggles.patch @@ -52,6 +52,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Panda.this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY); int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10; +diff --git a/src/main/java/net/minecraft/world/entity/monster/Bogged.java b/src/main/java/net/minecraft/world/entity/monster/Bogged.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java +@@ -0,0 +0,0 @@ public class Bogged extends AbstractSkeleton implements Shearable { + } + + private void spawnShearedMushrooms(ServerLevel world, ItemStack shears) { ++ this.forceDrops = true; // Paper - Add missing forceDrop toggles + this.dropFromShearingLootTable(world, BuiltInLootTables.BOGGED_SHEAR, shears, (worldserver1, itemstack1) -> { + this.spawnAtLocation(worldserver1, itemstack1, this.getBbHeight()); + }); ++ this.forceDrops = false; // Paper - Add missing forceDrop toggles + } + + @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java