mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
30 lines
1.7 KiB
Diff
30 lines
1.7 KiB
Diff
--- a/net/minecraft/world/level/block/BlockDragonEgg.java
|
|
+++ b/net/minecraft/world/level/block/BlockDragonEgg.java
|
|
@@ -16,6 +16,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);
|
|
@@ -53,6 +55,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();
|