diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch new file mode 100644 index 0000000000..f646cfcc54 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch @@ -0,0 +1,62 @@ +--- a/net/minecraft/world/level/block/WitherSkullBlock.java ++++ b/net/minecraft/world/level/block/WitherSkullBlock.java +@@ -25,6 +25,10 @@ + import net.minecraft.world.level.block.state.pattern.BlockPatternBuilder; + import net.minecraft.world.level.block.state.predicate.BlockStatePredicate; + ++// CraftBukkit start ++import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; ++// CraftBukkit end ++ + public class WitherSkullBlock extends SkullBlock { + + public static final MapCodec<WitherSkullBlock> CODEC = simpleCodec(WitherSkullBlock::new); +@@ -55,7 +57,8 @@ + + } + +- public static void checkSpawn(Level level, BlockPos blockpos, SkullBlockEntity skullblockentity) { ++ public static void checkSpawn(Level level, BlockPos pos, SkullBlockEntity blockEntity) { ++ if (level.captureBlockStates) return; // CraftBukkit + if (!level.isClientSide) { + BlockState blockstate = skullblockentity.getBlockState(); + boolean flag = blockstate.is(Blocks.WITHER_SKELETON_SKULL) || blockstate.is(Blocks.WITHER_SKELETON_WALL_SKULL); +@@ -66,14 +69,20 @@ + if (blockpattern_blockpatternmatch != null) { + WitherBoss witherboss = (WitherBoss) EntityType.WITHER.create(level); + +- if (witherboss != null) { +- CarvedPumpkinBlock.clearPatternBlocks(level, blockpattern_blockpatternmatch); +- BlockPos blockpos1 = blockpattern_blockpatternmatch.getBlock(1, 2, 0).getPos(); ++ if (entitywither != null) { ++ // BlockPumpkinCarved.clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - move down ++ BlockPos blockposition1 = shapedetector_shapedetectorcollection.getBlock(1, 2, 0).getPos(); + +- witherboss.moveTo((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.55D, (double) blockpos1.getZ() + 0.5D, blockpattern_blockpatternmatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F, 0.0F); +- witherboss.yBodyRot = blockpattern_blockpatternmatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F; +- witherboss.makeInvulnerable(); +- Iterator iterator = level.getEntitiesOfClass(ServerPlayer.class, witherboss.getBoundingBox().inflate(50.0D)).iterator(); ++ entitywither.moveTo((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F, 0.0F); ++ entitywither.yBodyRot = shapedetector_shapedetectorcollection.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F; ++ entitywither.makeInvulnerable(); ++ // CraftBukkit start ++ if (!level.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) { ++ return; ++ } ++ CarvedPumpkinBlock.clearPatternBlocks(level, shapedetector_shapedetectorcollection); // CraftBukkit - from above ++ // CraftBukkit end ++ Iterator iterator = level.getEntitiesOfClass(ServerPlayer.class, entitywither.getBoundingBox().inflate(50.0D)).iterator(); + + while (iterator.hasNext()) { + ServerPlayer serverplayer = (ServerPlayer) iterator.next(); +@@ -81,8 +90,8 @@ + CriteriaTriggers.SUMMONED_ENTITY.trigger(serverplayer, (Entity) witherboss); + } + +- level.addFreshEntity(witherboss); +- CarvedPumpkinBlock.updatePatternBlocks(level, blockpattern_blockpatternmatch); ++ // world.addFreshEntity(entitywither); // CraftBukkit - moved up ++ CarvedPumpkinBlock.updatePatternBlocks(level, shapedetector_shapedetectorcollection); + } + + } |