2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -24,6 +24,10 @@
|
2023-06-07 17:30:00 +02:00
|
|
|
import net.minecraft.world.level.block.state.predicate.BlockStatePredicate;
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.level.block.state.properties.BlockStateDirection;
|
2018-07-15 02:00:00 +02:00
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
2023-06-07 17:30:00 +02:00
|
|
|
public class BlockPumpkinCarved extends BlockFacingHorizontal {
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
public static final MapCodec<BlockPumpkinCarved> CODEC = simpleCodec(BlockPumpkinCarved::new);
|
|
|
|
@@ -86,9 +90,14 @@
|
2022-12-07 17:00:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-01-09 09:29:52 +01:00
|
|
|
+ if (!world.addFreshEntity(entity, (entity.getType() == EntityTypes.SNOW_GOLEM) ? SpawnReason.BUILD_SNOWMAN : SpawnReason.BUILD_IRONGOLEM)) {
|
2022-12-07 17:00:00 +01:00
|
|
|
+ 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()) {
|