summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockStationary.java
diff options
context:
space:
mode:
authorYariv Livay <yarivlivay@gmail.com>2013-03-17 22:46:48 +0200
committerTravis Watkins <amaranth@ubuntu.com>2013-03-18 12:47:01 -0500
commita7a5f273e3765a819f7d2ac71b4be4dbd28f9db4 (patch)
treecc24b480e39c5346abb8d6c6632b318bb6cba23c /src/main/java/net/minecraft/server/BlockStationary.java
parent2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd (diff)
downloadcraftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar
craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.gz
craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.lz
craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.xz
craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.zip
Implement new cause versions of BlockIgniteEvent. Addresses BUKKIT-3609, BUKKIT-3656, BUKKIT-3657
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockStationary.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockStationary.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/net/minecraft/server/BlockStationary.java b/src/main/java/net/minecraft/server/BlockStationary.java
index cf444680..14fbb0fd 100644
--- a/src/main/java/net/minecraft/server/BlockStationary.java
+++ b/src/main/java/net/minecraft/server/BlockStationary.java
@@ -2,10 +2,7 @@ package net.minecraft.server;
import java.util.Random;
-// CraftBukkit start
-import org.bukkit.craftbukkit.event.CraftEventFactory;
-import org.bukkit.event.block.BlockIgniteEvent;
-// CraftBukkit end
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockStationary extends BlockFluids {
@@ -42,9 +39,10 @@ public class BlockStationary extends BlockFluids {
int i1;
int j1;
- // CraftBukkit start - prevent lava putting something on fire
- org.bukkit.World bworld = world.getWorld();
- BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.LAVA;
+ // CraftBukkit start - prevent lava putting something on fire, remember igniter block coords
+ int x = i;
+ int y = j;
+ int z = k;
// CraftBukkit end
for (i1 = 0; i1 < l; ++i1) {
@@ -55,9 +53,8 @@ public class BlockStationary extends BlockFluids {
if (j1 == 0) {
if (this.m(world, i - 1, j, k) || this.m(world, i + 1, j, k) || this.m(world, i, j, k - 1) || this.m(world, i, j, k + 1) || this.m(world, i, j - 1, k) || this.m(world, i, j + 1, k)) {
// CraftBukkit start - prevent lava putting something on fire
- org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
- if (block.getTypeId() != Block.FIRE.id) {
- if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
+ if (world.getTypeId(i, j, k) != Block.FIRE.id) {
+ if (CraftEventFactory.callBlockIgniteEvent(world, i, j, k, x, y, z).isCancelled()) {
continue;
}
}
@@ -80,9 +77,8 @@ public class BlockStationary extends BlockFluids {
k = j1 + random.nextInt(3) - 1;
if (world.isEmpty(i, j + 1, k) && this.m(world, i, j, k)) {
// CraftBukkit start - prevent lava putting something on fire
- org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k);
- if (block.getTypeId() != Block.FIRE.id) {
- if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
+ if (world.getTypeId(i, j + 1, k) != Block.FIRE.id) {
+ if (CraftEventFactory.callBlockIgniteEvent(world, i, j + 1, k, x, y, z).isCancelled()) {
continue;
}
}