summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockDragonEgg.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/BlockDragonEgg.patch')
-rw-r--r--nms-patches/BlockDragonEgg.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/nms-patches/BlockDragonEgg.patch b/nms-patches/BlockDragonEgg.patch
new file mode 100644
index 00000000..d2415b9b
--- /dev/null
+++ b/nms-patches/BlockDragonEgg.patch
@@ -0,0 +1,30 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/BlockDragonEgg.java 2014-11-27 08:59:46.525422622 +1100
++++ src/main/java/net/minecraft/server/BlockDragonEgg.java 2014-11-27 08:42:10.152850911 +1100
+@@ -2,6 +2,8 @@
+
+ import java.util.Random;
+
++import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
++
+ public class BlockDragonEgg extends Block {
+
+ public BlockDragonEgg() {
+@@ -61,6 +63,18 @@
+ BlockPosition blockposition1 = blockposition.a(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.getType(blockposition1).getBlock().material == Material.AIR) {
++ // 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.isStatic) {
+ for (int j = 0; j < 128; ++j) {
+ double d0 = world.random.nextDouble();