diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-02-23 13:33:16 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-25 19:17:12 -0500 |
commit | 57bd84510f4d11c5a132539074ecd5320bd54fab (patch) | |
tree | a1ef11f0f3f2100710598ab069785183af2d62e2 /src | |
parent | 5901a7456516a263fa167c6082937f8cf24b5f7f (diff) | |
download | craftbukkit-57bd84510f4d11c5a132539074ecd5320bd54fab.tar craftbukkit-57bd84510f4d11c5a132539074ecd5320bd54fab.tar.gz craftbukkit-57bd84510f4d11c5a132539074ecd5320bd54fab.tar.lz craftbukkit-57bd84510f4d11c5a132539074ecd5320bd54fab.tar.xz craftbukkit-57bd84510f4d11c5a132539074ecd5320bd54fab.zip |
[Bleeding] Made dragon eggs trigger BlockFromTo events when they teleport. Addresses BUKKIT-828
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockDragonEgg.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java index 9d7988fa..66f26f59 100644 --- a/src/main/java/net/minecraft/server/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java @@ -61,6 +61,19 @@ public class BlockDragonEgg extends Block { int k1 = k + world.random.nextInt(16) - world.random.nextInt(16); if (world.getTypeId(i1, j1, k1) == 0) { + // CraftBukkit start + org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k); + org.bukkit.block.Block to = world.getWorld().getBlockAt(i1, j1, k1); + org.bukkit.event.block.BlockFromToEvent event = new org.bukkit.event.block.BlockFromToEvent(from, to); + org.bukkit.Bukkit.getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + i1 = event.getToBlock().getX(); + j1 = event.getToBlock().getY(); + k1 = event.getToBlock().getZ(); + } else return; + // CraftBukkit end + world.setTypeIdAndData(i1, j1, k1, this.id, world.getData(i, j, k)); world.setTypeId(i, j, k, 0); short short1 = 128; |