From 5e6ac3c46ef0503dc953cb48bf8f5c35610dee0a Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 9 Dec 2022 16:37:03 -0800 Subject: [PATCH] Properly identify golem spawn reason (#8635) --- ...and-additions-to-the-SpawnReason-API.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/patches/server/0944-Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/0944-Fixes-and-additions-to-the-SpawnReason-API.patch index 86feead4ab..3a58964312 100644 --- a/patches/server/0944-Fixes-and-additions-to-the-SpawnReason-API.patch +++ b/patches/server/0944-Fixes-and-additions-to-the-SpawnReason-API.patch @@ -33,6 +33,29 @@ index 6afe37e42d88701af38df5793a9ea9d7d2cda5c5..c72ab3c9f7cb20f22b051981fe1fc419 } else areaEffectCloud.discard(); // Paper this.discard(); } +diff --git a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java +index 3a6b84fab71d65be6215bde5bdabb303d418623e..f77dd9f9dc89d880386cc2da398cd7ec9c768c43 100644 +--- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java +@@ -89,7 +89,17 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We + // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down + entity.moveTo((double) pos.getX() + 0.5D, (double) pos.getY() + 0.05D, (double) pos.getZ() + 0.5D, 0.0F, 0.0F); + // CraftBukkit start +- if (!world.addFreshEntity(entity, SpawnReason.BUILD_IRONGOLEM)) { ++ // Paper start - correct spawn reason ++ final SpawnReason spawnReason; ++ if (entity.getType() == EntityType.SNOW_GOLEM) { ++ spawnReason = SpawnReason.BUILD_SNOWMAN; ++ } else if (entity.getType() == EntityType.IRON_GOLEM) { ++ spawnReason = SpawnReason.BUILD_IRONGOLEM; ++ } else { ++ spawnReason = SpawnReason.DEFAULT; ++ } ++ if (!world.addFreshEntity(entity, spawnReason)) { ++ // Paper end + return; + } + CarvedPumpkinBlock.clearPatternBlocks(world, patternResult); // CraftBukkit - from above diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java index 294d22b6b27e96b59c77527efcfefa9410b756e4..bebcdc70c4cb01764428836fff76f03b94f2eae8 100644 --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java