diff options
author | Taylor Kelly <tkelly910@gmail.com> | 2011-01-30 15:30:30 -0500 |
---|---|---|
committer | Taylor Kelly <tkelly910@gmail.com> | 2011-01-30 15:30:30 -0500 |
commit | 35aac122356b7237e461c8e1faf0c7b49e308aef (patch) | |
tree | d54385243e91d7c2647cb658b8d8a9667610e560 /src/main/java/net/minecraft | |
parent | 914688e2a07dc99421a3c512c2df59b770ea3d17 (diff) | |
download | craftbukkit-35aac122356b7237e461c8e1faf0c7b49e308aef.tar craftbukkit-35aac122356b7237e461c8e1faf0c7b49e308aef.tar.gz craftbukkit-35aac122356b7237e461c8e1faf0c7b49e308aef.tar.lz craftbukkit-35aac122356b7237e461c8e1faf0c7b49e308aef.tar.xz craftbukkit-35aac122356b7237e461c8e1faf0c7b49e308aef.zip |
Re-add BlockBurnEvent
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockFire.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java index f7ec1ea4..85dc9d42 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -120,16 +120,24 @@ public class BlockFire extends Block { if (random.nextInt(l) < i1) { boolean flag = world.getTypeId(i, j, k) == Block.TNT.id; + // CraftBukkit start: BlockBurnEvent + Server server = ((WorldServer)world).getServer(); + CraftWorld cworld = ((WorldServer)world).getWorld(); + org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k)); + BlockBurnEvent burnEvent = new BlockBurnEvent(theBlock); + server.getPluginManager().callEvent(burnEvent); + if(!burnEvent.isCancelled()) { + if (random.nextInt(2) == 0) { + world.e(i, j, k, this.id); + } else { + world.e(i, j, k, 0); + } - if (random.nextInt(2) == 0) { - world.e(i, j, k, this.id); - } else { - world.e(i, j, k, 0); - } - - if (flag) { - Block.TNT.a(world, i, j, k, 0); + if (flag) { + Block.TNT.a(world, i, j, k, 0); + } } + // CraftBukkit end: BlockBurnEvent } } |