aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch b/patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch
new file mode 100644
index 0000000000..00de2418d7
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockPumpkinCarved.patch
@@ -0,0 +1,30 @@
+--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
++++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
+@@ -24,6 +24,10 @@
+ import net.minecraft.world.level.block.state.predicate.BlockStatePredicate;
+ import net.minecraft.world.level.block.state.properties.BlockStateDirection;
+
++// CraftBukkit start
++import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
++// CraftBukkit end
++
+ public class BlockPumpkinCarved extends BlockFacingHorizontal {
+
+ public static final MapCodec<BlockPumpkinCarved> CODEC = simpleCodec(BlockPumpkinCarved::new);
+@@ -86,9 +90,14 @@
+ }
+
+ private static void spawnGolemInWorld(World world, ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection, Entity entity, BlockPosition blockposition) {
+- clearPatternBlocks(world, shapedetector_shapedetectorcollection);
++ // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down
+ entity.moveTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.05D, (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
+- world.addFreshEntity(entity);
++ // CraftBukkit start
++ if (!world.addFreshEntity(entity, SpawnReason.BUILD_IRONGOLEM)) {
++ return;
++ }
++ clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - from above
++ // CraftBukkit end
+ Iterator iterator = world.getEntitiesOfClass(EntityPlayer.class, entity.getBoundingBox().inflate(5.0D)).iterator();
+
+ while (iterator.hasNext()) {