Update CraftBukkit to Minecraft 1.5
This commit is contained in:
@@ -17,25 +17,24 @@ public class BlockFlowing extends BlockFluids {
|
||||
super(i, material);
|
||||
}
|
||||
|
||||
private void l(World world, int i, int j, int k) {
|
||||
private void k(World world, int i, int j, int k) {
|
||||
int l = world.getData(i, j, k);
|
||||
|
||||
world.setRawTypeIdAndData(i, j, k, this.id + 1, l);
|
||||
world.e(i, j, k, i, j, k);
|
||||
world.setTypeIdAndData(i, j, k, this.id + 1, l, 2);
|
||||
}
|
||||
|
||||
public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
return this.material != Material.LAVA;
|
||||
}
|
||||
|
||||
public void b(World world, int i, int j, int k, Random random) {
|
||||
public void a(World world, int i, int j, int k, Random random) {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
org.bukkit.Server server = world.getServer();
|
||||
org.bukkit.block.Block source = bworld == null ? null : bworld.getBlockAt(i, j, k);
|
||||
// CraftBukkit end
|
||||
|
||||
int l = this.f_(world, i, j, k);
|
||||
int l = this.k_(world, i, j, k);
|
||||
byte b0 = 1;
|
||||
|
||||
if (this.material == Material.LAVA && !world.worldProvider.e) {
|
||||
@@ -59,8 +58,8 @@ public class BlockFlowing extends BlockFluids {
|
||||
i1 = -1;
|
||||
}
|
||||
|
||||
if (this.f_(world, i, j + 1, k) >= 0) {
|
||||
int k1 = this.f_(world, i, j + 1, k);
|
||||
if (this.k_(world, i, j + 1, k) >= 0) {
|
||||
int k1 = this.k_(world, i, j + 1, k);
|
||||
|
||||
if (k1 >= 8) {
|
||||
i1 = k1;
|
||||
@@ -72,7 +71,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
if (this.a >= 2 && this.material == Material.WATER) {
|
||||
if (world.getMaterial(i, j - 1, k).isBuildable()) {
|
||||
i1 = 0;
|
||||
} else if (world.getMaterial(i, j - 1, k) == this.material && world.getData(i, j, k) == 0) {
|
||||
} else if (world.getMaterial(i, j - 1, k) == this.material && world.getData(i, j - 1, k) == 0) {
|
||||
i1 = 0;
|
||||
}
|
||||
}
|
||||
@@ -84,23 +83,23 @@ public class BlockFlowing extends BlockFluids {
|
||||
|
||||
if (i1 == l) {
|
||||
if (flag) {
|
||||
this.l(world, i, j, k);
|
||||
this.k(world, i, j, k);
|
||||
}
|
||||
} else {
|
||||
l = i1;
|
||||
if (i1 < 0) {
|
||||
world.setTypeId(i, j, k, 0);
|
||||
world.setAir(i, j, k);
|
||||
} else {
|
||||
world.setData(i, j, k, i1);
|
||||
world.a(i, j, k, this.id, this.r_());
|
||||
world.setData(i, j, k, i1, 2);
|
||||
world.a(i, j, k, this.id, this.a(world));
|
||||
world.applyPhysics(i, j, k, this.id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.l(world, i, j, k);
|
||||
this.k(world, i, j, k);
|
||||
}
|
||||
|
||||
if (this.p(world, i, j - 1, k)) {
|
||||
if (this.o(world, i, j - 1, k)) {
|
||||
// CraftBukkit start - send "down" to the server
|
||||
BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN);
|
||||
if (server != null) {
|
||||
@@ -109,7 +108,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (this.material == Material.LAVA && world.getMaterial(i, j - 1, k) == Material.WATER) {
|
||||
world.setTypeId(i, j - 1, k, Block.STONE.id);
|
||||
world.setTypeIdUpdate(i, j - 1, k, Block.STONE.id);
|
||||
this.fizz(world, i, j - 1, k);
|
||||
return;
|
||||
}
|
||||
@@ -121,8 +120,8 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else if (l >= 0 && (l == 0 || this.o(world, i, j - 1, k))) {
|
||||
boolean[] aboolean = this.n(world, i, j, k);
|
||||
} else if (l >= 0 && (l == 0 || this.n(world, i, j - 1, k))) {
|
||||
boolean[] aboolean = this.m(world, i, j, k);
|
||||
|
||||
i1 = l + b0;
|
||||
if (l >= 8) {
|
||||
@@ -156,7 +155,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
private void flow(World world, int i, int j, int k, int l) {
|
||||
if (this.p(world, i, j, k)) {
|
||||
if (this.o(world, i, j, k)) {
|
||||
int i1 = world.getTypeId(i, j, k);
|
||||
|
||||
if (i1 > 0) {
|
||||
@@ -167,7 +166,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
}
|
||||
|
||||
world.setTypeIdAndData(i, j, k, this.id, l);
|
||||
world.setTypeIdAndData(i, j, k, this.id, l, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,8 +194,8 @@ public class BlockFlowing extends BlockFluids {
|
||||
++i2;
|
||||
}
|
||||
|
||||
if (!this.o(world, l1, j, i2) && (world.getMaterial(l1, j, i2) != this.material || world.getData(l1, j, i2) != 0)) {
|
||||
if (!this.o(world, l1, j - 1, i2)) {
|
||||
if (!this.n(world, l1, j, i2) && (world.getMaterial(l1, j, i2) != this.material || world.getData(l1, j, i2) != 0)) {
|
||||
if (!this.n(world, l1, j - 1, i2)) {
|
||||
return l;
|
||||
}
|
||||
|
||||
@@ -214,7 +213,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
return j1;
|
||||
}
|
||||
|
||||
private boolean[] n(World world, int i, int j, int k) {
|
||||
private boolean[] m(World world, int i, int j, int k) {
|
||||
int l;
|
||||
int i1;
|
||||
|
||||
@@ -239,8 +238,8 @@ public class BlockFlowing extends BlockFluids {
|
||||
++j1;
|
||||
}
|
||||
|
||||
if (!this.o(world, i1, j, j1) && (world.getMaterial(i1, j, j1) != this.material || world.getData(i1, j, j1) != 0)) {
|
||||
if (this.o(world, i1, j - 1, j1)) {
|
||||
if (!this.n(world, i1, j, j1) && (world.getMaterial(i1, j, j1) != this.material || world.getData(i1, j, j1) != 0)) {
|
||||
if (this.n(world, i1, j - 1, j1)) {
|
||||
this.c[l] = this.d(world, i1, j, j1, 1, l);
|
||||
} else {
|
||||
this.c[l] = 0;
|
||||
@@ -263,7 +262,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
private boolean o(World world, int i, int j, int k) {
|
||||
private boolean n(World world, int i, int j, int k) {
|
||||
int l = world.getTypeId(i, j, k);
|
||||
|
||||
if (l != Block.WOODEN_DOOR.id && l != Block.IRON_DOOR_BLOCK.id && l != Block.SIGN_POST.id && l != Block.LADDER.id && l != Block.SUGAR_CANE_BLOCK.id) {
|
||||
@@ -280,7 +279,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
protected int d(World world, int i, int j, int k, int l) {
|
||||
int i1 = this.f_(world, i, j, k);
|
||||
int i1 = this.k_(world, i, j, k);
|
||||
|
||||
if (i1 < 0) {
|
||||
return l;
|
||||
@@ -297,16 +296,16 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean p(World world, int i, int j, int k) {
|
||||
private boolean o(World world, int i, int j, int k) {
|
||||
Material material = world.getMaterial(i, j, k);
|
||||
|
||||
return material == this.material ? false : (material == Material.LAVA ? false : !this.o(world, i, j, k));
|
||||
return material == this.material ? false : (material == Material.LAVA ? false : !this.n(world, i, j, k));
|
||||
}
|
||||
|
||||
public void onPlace(World world, int i, int j, int k) {
|
||||
super.onPlace(world, i, j, k);
|
||||
if (world.getTypeId(i, j, k) == this.id) {
|
||||
world.a(i, j, k, this.id, this.r_());
|
||||
world.a(i, j, k, this.id, this.a(world));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user