summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTaylor Kelly <tkelly910@gmail.com>2011-01-26 16:13:27 -0500
committerTaylor Kelly <tkelly910@gmail.com>2011-01-26 16:13:27 -0500
commitf11e575a7214983278567e8b127b86ac83e7af38 (patch)
tree2cb88348f8ea5ac68235a37c0216f79185a295c2 /src/main/java
parent7a898bdba8257a5f98ebdae99fa38b4429ca5828 (diff)
downloadcraftbukkit-f11e575a7214983278567e8b127b86ac83e7af38.tar
craftbukkit-f11e575a7214983278567e8b127b86ac83e7af38.tar.gz
craftbukkit-f11e575a7214983278567e8b127b86ac83e7af38.tar.lz
craftbukkit-f11e575a7214983278567e8b127b86ac83e7af38.tar.xz
craftbukkit-f11e575a7214983278567e8b127b86ac83e7af38.zip
BlockBurnEvent
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/BlockFire.java50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index d3c8e396..c1b6279d 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -7,6 +7,7 @@ import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.craftbukkit.CraftWorld;
import java.util.Random;
+import org.bukkit.event.block.BlockBurnEvent;
// CraftBukkit end
public class BlockFire extends Block {
@@ -116,31 +117,36 @@ public class BlockFire extends Block {
if (random.nextInt(l) < i1) {
boolean flag = world.a(i, j, k) == Block.am.bi;
-
- if (random.nextInt(2) == 0) {
- // CraftBukkit start: Call to stop very slow spread of fire.
- Server server = ((WorldServer)world).getServer();
- CraftWorld cworld = ((WorldServer)world).getWorld();
-
- org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
- IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SLOW_SPREAD;
- Player thePlayer = null;
-
- if (theBlock.getTypeId() != Block.ar.bi){
- BlockIgniteEvent event = new BlockIgniteEvent(theBlock, igniteCause, thePlayer);
- server.getPluginManager().callEvent(event);
- if (event.isCancelled()) {
- return;
+ // 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) {
+ // CraftBukkit start: Call to stop very slow spread of fire.
+
+ IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SLOW_SPREAD;
+ Player thePlayer = null;
+
+ if (theBlock.getTypeId() != Block.ar.bi){
+ BlockIgniteEvent event = new BlockIgniteEvent(theBlock, igniteCause, thePlayer);
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
}
+ // CraftBukkit end
+ world.e(i, j, k, bi);
+ } else {
+ world.e(i, j, k, 0);
+ }
+ if (flag) {
+ Block.am.a(world, i, j, k, 0);
}
- // CraftBukkit end
- world.e(i, j, k, bi);
- } else {
- world.e(i, j, k, 0);
- }
- if (flag) {
- Block.am.a(world, i, j, k, 0);
}
+ // CraftBukkit end: BlockBurnEvent
}
}