summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockStationary.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockStationary.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockStationary.java52
1 files changed, 24 insertions, 28 deletions
diff --git a/src/main/java/net/minecraft/server/BlockStationary.java b/src/main/java/net/minecraft/server/BlockStationary.java
index ca051d42..0de0c5b8 100644
--- a/src/main/java/net/minecraft/server/BlockStationary.java
+++ b/src/main/java/net/minecraft/server/BlockStationary.java
@@ -6,30 +6,26 @@ import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockStationary extends BlockFluids {
- protected BlockStationary(int i, Material material) {
- super(i, material);
- this.b(false);
+ protected BlockStationary(Material material) {
+ super(material);
+ this.a(false);
if (material == Material.LAVA) {
- this.b(true);
+ this.a(true);
}
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
- return this.material != Material.LAVA;
- }
-
- public void doPhysics(World world, int i, int j, int k, int l) {
- super.doPhysics(world, i, j, k, l);
- if (world.getTypeId(i, j, k) == this.id) {
- this.k(world, i, j, k);
+ public void doPhysics(World world, int i, int j, int k, Block block) {
+ super.doPhysics(world, i, j, k, block);
+ if (world.getType(i, j, k) == this) {
+ this.n(world, i, j, k);
}
}
- private void k(World world, int i, int j, int k) {
+ private void n(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
- world.setTypeIdAndData(i, j, k, this.id - 1, l, 2);
- world.a(i, j, k, this.id - 1, this.a(world));
+ world.setTypeAndData(i, j, k, Block.e(Block.b((Block) this) - 1), l, 2);
+ world.a(i, j, k, Block.e(Block.b((Block) this) - 1), this.a(world));
}
public void a(World world, int i, int j, int k, Random random) {
@@ -37,7 +33,6 @@ public class BlockStationary extends BlockFluids {
int l = random.nextInt(3);
int i1;
- int j1;
// CraftBukkit start - Prevent lava putting something on fire, remember igniter block coords
int x = i;
@@ -49,49 +44,50 @@ public class BlockStationary extends BlockFluids {
i += random.nextInt(3) - 1;
++j;
k += random.nextInt(3) - 1;
- j1 = world.getTypeId(i, j, k);
- 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)) {
+ Block block = world.getType(i, j, k);
+
+ if (block.material == Material.AIR) {
+ if (this.o(world, i - 1, j, k) || this.o(world, i + 1, j, k) || this.o(world, i, j, k - 1) || this.o(world, i, j, k + 1) || this.o(world, i, j - 1, k) || this.o(world, i, j + 1, k)) {
// CraftBukkit start - Prevent lava putting something on fire
- if (world.getTypeId(i, j, k) != Block.FIRE.id) {
+ if (world.getType(i, j, k) != Blocks.FIRE) {
if (CraftEventFactory.callBlockIgniteEvent(world, i, j, k, x, y, z).isCancelled()) {
continue;
}
}
// CraftBukkit end
- world.setTypeIdUpdate(i, j, k, Block.FIRE.id);
+ world.setTypeUpdate(i, j, k, Blocks.FIRE);
return;
}
- } else if (Block.byId[j1].material.isSolid()) {
+ } else if (block.material.isSolid()) {
return;
}
}
if (l == 0) {
i1 = i;
- j1 = k;
+ int j1 = k;
for (int k1 = 0; k1 < 3; ++k1) {
i = i1 + random.nextInt(3) - 1;
k = j1 + random.nextInt(3) - 1;
- if (world.isEmpty(i, j + 1, k) && this.m(world, i, j, k)) {
+ if (world.isEmpty(i, j + 1, k) && this.o(world, i, j, k)) {
// CraftBukkit start - Prevent lava putting something on fire
- if (world.getTypeId(i, j + 1, k) != Block.FIRE.id) {
+ if (world.getType(i, j + 1, k) != Blocks.FIRE) {
if (CraftEventFactory.callBlockIgniteEvent(world, i, j + 1, k, x, y, z).isCancelled()) {
continue;
}
}
// CraftBukkit end
- world.setTypeIdUpdate(i, j + 1, k, Block.FIRE.id);
+ world.setTypeUpdate(i, j + 1, k, Blocks.FIRE);
}
}
}
}
}
- private boolean m(World world, int i, int j, int k) {
- return world.getMaterial(i, j, k).isBurnable();
+ private boolean o(World world, int i, int j, int k) {
+ return world.getType(i, j, k).getMaterial().isBurnable();
}
}