diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockDragonEgg.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/BlockDragonEgg.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockDragonEgg.patch b/patch-remap/og/net/minecraft/world/level/block/BlockDragonEgg.patch new file mode 100644 index 0000000000..ab3c8078a6 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/BlockDragonEgg.patch @@ -0,0 +1,30 @@ +--- a/net/minecraft/world/level/block/BlockDragonEgg.java ++++ b/net/minecraft/world/level/block/BlockDragonEgg.java +@@ -17,6 +17,8 @@ + import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.phys.shapes.VoxelShapeCollision; + ++import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit ++ + public class BlockDragonEgg extends BlockFalling { + + public static final MapCodec<BlockDragonEgg> CODEC = simpleCodec(BlockDragonEgg::new); +@@ -54,6 +56,18 @@ + BlockPosition blockposition1 = blockposition.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16)); + + if (world.getBlockState(blockposition1).isAir() && worldborder.isWithinBounds(blockposition1)) { ++ // CraftBukkit start ++ org.bukkit.block.Block from = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block to = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); ++ BlockFromToEvent event = new BlockFromToEvent(from, to); ++ org.bukkit.Bukkit.getPluginManager().callEvent(event); ++ ++ if (event.isCancelled()) { ++ return; ++ } ++ ++ blockposition1 = new BlockPosition(event.getToBlock().getX(), event.getToBlock().getY(), event.getToBlock().getZ()); ++ // CraftBukkit end + if (world.isClientSide) { + for (int j = 0; j < 128; ++j) { + double d0 = world.random.nextDouble(); |