aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch
new file mode 100644
index 0000000000..a4f62eda4d
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/WitherSkullBlock.java.patch
@@ -0,0 +1,58 @@
+--- a/net/minecraft/world/level/block/WitherSkullBlock.java
++++ b/net/minecraft/world/level/block/WitherSkullBlock.java
+@@ -23,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);
+ @Nullable
+@@ -49,6 +58,7 @@
+ }
+
+ public static void checkSpawn(Level level, BlockPos pos, SkullBlockEntity blockEntity) {
++ if (level.captureBlockStates) return; // CraftBukkit
+ if (!level.isClientSide) {
+ BlockState blockState = blockEntity.getBlockState();
+ boolean flag = blockState.is(Blocks.WITHER_SKELETON_SKULL) || blockState.is(Blocks.WITHER_SKELETON_WALL_SKULL);
+@@ -69,12 +66,32 @@
+ witherBoss.yBodyRot = blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F;
+ witherBoss.makeInvulnerable();
+
+- for (ServerPlayer serverPlayer : level.getEntitiesOfClass(ServerPlayer.class, witherBoss.getBoundingBox().inflate(50.0))) {
+- CriteriaTriggers.SUMMONED_ENTITY.trigger(serverPlayer, witherBoss);
++ if (shapedetector_shapedetectorcollection != null) {
++ WitherBoss entitywither = (WitherBoss) EntityType.WITHER.create(level);
++
++ if (entitywither != null) {
++ // BlockPumpkinCarved.clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - move down
++ BlockPos blockposition1 = shapedetector_shapedetectorcollection.getBlock(1, 2, 0).getPos();
++
++ 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();
+
+- level.addFreshEntity(witherBoss);
+- CarvedPumpkinBlock.updatePatternBlocks(level, blockPatternMatch);
++ while (iterator.hasNext()) {
++ ServerPlayer entityplayer = (ServerPlayer) iterator.next();
++
++ CriteriaTriggers.SUMMONED_ENTITY.trigger(entityplayer, (Entity) entitywither);
++ }
++
++ // world.addFreshEntity(entitywither); // CraftBukkit - moved up
++ CarvedPumpkinBlock.updatePatternBlocks(level, shapedetector_shapedetectorcollection);
+ }
+ }
+ }