mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
9d740b84b0
By: md_5 <git@md-5.net>
30 lines
1.5 KiB
Diff
30 lines
1.5 KiB
Diff
--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
|
+++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
|
|
@@ -23,6 +23,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 BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
|
@@ -79,9 +83,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()) {
|