fix shear drops for wolf and bogged

Fixes #10661
This commit is contained in:
Jake Potrebic 2024-05-04 22:48:06 -07:00
parent 7b2ce17e23
commit f51bdcf978
2 changed files with 19 additions and 1 deletions

View file

@ -241,7 +241,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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

View file

@ -56,6 +56,20 @@ 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/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java