diff options
author | Jake Potrebic <[email protected]> | 2024-05-04 22:48:06 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-05-04 22:48:10 -0700 |
commit | 7401313e16a03156f1ab09fc5eeee44ae431692a (patch) | |
tree | 248b994e500af2bda813a10ce61a19893b76e3cf | |
parent | 6fcca46674f7ebbc261bd63339fbdcba21ab5133 (diff) | |
download | Paper-7401313e16a03156f1ab09fc5eeee44ae431692a.tar.gz Paper-7401313e16a03156f1ab09fc5eeee44ae431692a.zip |
fix shear drops for wolf and bogged
Fixes #10661
-rw-r--r-- | patches/server/0582-Add-missing-forceDrop-toggles.patch | 14 | ||||
-rw-r--r-- | patches/server/0943-Add-drops-to-shear-events.patch | 12 |
2 files changed, 22 insertions, 4 deletions
diff --git a/patches/server/0582-Add-missing-forceDrop-toggles.patch b/patches/server/0582-Add-missing-forceDrop-toggles.patch index 951b6714fa..b89de7428a 100644 --- a/patches/server/0582-Add-missing-forceDrop-toggles.patch +++ b/patches/server/0582-Add-missing-forceDrop-toggles.patch @@ -56,6 +56,20 @@ index fb4c7220c4edad54813036d62db7e3eefeda92a3..83d8a09980c4ab3c7c97b07c3dcdb3d7 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/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java +index 11f4a2e15d42a029406fe8399b8d93ae136f0295..5ebf49a565af4ab3bead60a83bca2e6561e6a29c 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java +@@ -468,7 +468,9 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol + this.playSound(SoundEvents.ARMOR_UNEQUIP_WOLF); + itemstack1 = this.getBodyArmorItem(); + this.setBodyArmorItem(ItemStack.EMPTY); ++ this.forceDrops = true; // Paper - add missing forceDrops toggles + this.spawnAtLocation(itemstack1); ++ this.forceDrops = false; // Paper - add missing forceDrops toggles + return InteractionResult.SUCCESS; + } else if (((Ingredient) ((ArmorMaterial) ArmorMaterials.ARMADILLO.value()).repairIngredient().get()).test(itemstack) && this.isInSittingPose() && this.hasArmor() && this.isOwnedBy(player) && this.getBodyArmorItem().isDamaged()) { + itemstack.shrink(1); 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 e1f2425ae6d3737302f6a7e010b172a62b41a018..20d9690127aed9c8ae2632bcf497ba0e473b7bea 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java diff --git a/patches/server/0943-Add-drops-to-shear-events.patch b/patches/server/0943-Add-drops-to-shear-events.patch index 40a0413a25..ad99ccecb4 100644 --- a/patches/server/0943-Add-drops-to-shear-events.patch +++ b/patches/server/0943-Add-drops-to-shear-events.patch @@ -233,22 +233,26 @@ index 2de1a2f666da9db1832907e1651dbff948e37252..5c2ed3c39c8eb850f3be1e2ea5b5a7ea } 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 9c0bfddd479eef688d2509ad700371c3c860ff1a..754eb747179d9318bc5a3883e5622cc400c4e06c 100644 +index 9c0bfddd479eef688d2509ad700371c3c860ff1a..e9f9b041ae7195e9d23bd446454b1d8c47a1ace1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java +++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java -@@ -135,6 +135,11 @@ public class Bogged extends AbstractSkeleton implements Shearable { +@@ -135,6 +135,15 @@ public class Bogged extends AbstractSkeleton implements Shearable { } private void spawnShearedMushrooms() { + // Paper start - shear drops API -+ this.generateShearedMushrooms(this::spawnAtLocation); ++ this.generateShearedMushrooms(stack -> { ++ this.forceDrops = true; ++ this.spawnAtLocation(stack); ++ this.forceDrops = false; ++ }); + } + private void generateShearedMushrooms(java.util.function.Consumer<ItemStack> stackConsumer) { + // Paper end - shear drops API if (this.level() instanceof ServerLevel serverLevel && serverLevel.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { LootTable lootTable = serverLevel.getServer().reloadableRegistries().getLootTable(BuiltInLootTables.BOGGED_SHEAR); LootParams lootParams = new LootParams.Builder(serverLevel) -@@ -143,11 +148,20 @@ public class Bogged extends AbstractSkeleton implements Shearable { +@@ -143,11 +152,20 @@ public class Bogged extends AbstractSkeleton implements Shearable { .create(LootContextParamSets.SHEARING); for (ItemStack itemStack : lootTable.getRandomItems(lootParams)) { |