From 5ada2514df6c39b209627002868e8920e35816a0 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:14:19 +0100 Subject: [PATCH] Fix drops for shearing mushroom cow (#11632) --- patches/server/Add-drops-to-shear-events.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/patches/server/Add-drops-to-shear-events.patch b/patches/server/Add-drops-to-shear-events.patch index 5ab5974b57..27f569a41b 100644 --- a/patches/server/Add-drops-to-shear-events.patch +++ b/patches/server/Add-drops-to-shear-events.patch @@ -113,13 +113,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } - worldserver1.addFreshEntity(entityitem); - // CraftBukkit end -+ // Paper start - custom shear drops; moved drop generation to separate method -+ drops.forEach(itemstack1 -> { -+ for (final ItemStack drop : drops) { -+ ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(1.0D), this.getZ(), drop); -+ this.spawnAtLocation(world, entityitem); - } +- } - ++ // Paper start - custom shear drops; moved drop generation to separate method ++ drops.forEach(drop -> { ++ ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(1.0D), this.getZ(), drop); ++ this.spawnAtLocation(world, entityitem); + // Paper end - custom shear drops; moved drop generation to separate method }); }, EntityTransformEvent.TransformReason.SHEARED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED); // CraftBukkit @@ -177,8 +176,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + drops.forEach(itemstack1 -> { // Paper - custom drops - loop in generated default drops + if (true) { // Paper - custom drops - loop in generated default drops this.forceDrops = true; // CraftBukkit - ItemEntity entityitem = this.spawnAtLocation(worldserver1, itemstack1.copyWithCount(1), 1.0F); +- ItemEntity entityitem = this.spawnAtLocation(worldserver1, itemstack1.copyWithCount(1), 1.0F); ++ ItemEntity entityitem = this.spawnAtLocation(worldserver1, itemstack1, 1.0F); // Paper - custom drops - copy already done above this.forceDrops = false; // CraftBukkit + + if (entityitem != null) { diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java