13
0
geforkt von Mirrors/Paper

Fixed rain not putting out fires due to a mistranslation issue.

Dieser Commit ist enthalten in:
EvilSeph 2011-04-25 21:08:52 -04:00
Ursprung d2a4c510b3
Commit b2c558eab1

Datei anzeigen

@ -50,62 +50,67 @@ public class BlockFire extends Block {
public void a(World world, int i, int j, int k, Random random) { public void a(World world, int i, int j, int k, Random random) {
boolean flag = world.getTypeId(i, j - 1, k) == Block.NETHERRACK.id; boolean flag = world.getTypeId(i, j - 1, k) == Block.NETHERRACK.id;
int l = world.getData(i, j, k);
if (l < 15) { if (!flag && world.v() && (world.q(i, j, k) || world.q(i - 1, j, k) || world.q(i + 1, j, k) || world.q(i, j, k - 1) || world.q(i, j, k + 1))) {
world.setData(i, j, k, l + 1);
world.c(i, j, k, this.id, this.b());
}
if (!flag && !this.g(world, i, j, k)) {
if (!world.d(i, j - 1, k) || l > 3) {
world.setTypeId(i, j, k, 0);
}
} else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} else { } else {
if (l % 2 == 0 && l > 2) { int l = world.getData(i, j, k);
this.a(world, i + 1, j, k, 300, random);
this.a(world, i - 1, j, k, 300, random);
this.a(world, i, j - 1, k, 250, random);
this.a(world, i, j + 1, k, 250, random);
this.a(world, i, j, k - 1, 300, random);
this.a(world, i, j, k + 1, 300, random);
// CraftBukkit start - Call to stop spread of fire. if (l < 15) {
Server server = ((WorldServer) world).getServer(); world.setData(i, j, k, l + 1);
CraftWorld cworld = ((WorldServer) world).getWorld(); world.c(i, j, k, this.id, this.b());
}
IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD; if (!flag && !this.g(world, i, j, k)) {
Player thePlayer = null; if (!world.d(i, j - 1, k) || l > 3) {
// CraftBukkit world.setTypeId(i, j, k, 0);
}
} else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
world.setTypeId(i, j, k, 0);
} else {
if (l % 2 == 0 && l > 2) {
this.a(world, i + 1, j, k, 300, random);
this.a(world, i - 1, j, k, 300, random);
this.a(world, i, j - 1, k, 250, random);
this.a(world, i, j + 1, k, 250, random);
this.a(world, i, j, k - 1, 300, random);
this.a(world, i, j, k + 1, 300, random);
for (int i1 = i - 1; i1 <= i + 1; ++i1) { // CraftBukkit start - Call to stop spread of fire.
for (int j1 = k - 1; j1 <= k + 1; ++j1) { Server server = ((WorldServer) world).getServer();
for (int k1 = j - 1; k1 <= j + 4; ++k1) { CraftWorld cworld = ((WorldServer) world).getWorld();
if (i1 != i || k1 != j || j1 != k) {
int l1 = 100;
if (k1 > j + 1) { IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD;
l1 += (k1 - (j + 1)) * 100; Player thePlayer = null;
} // CraftBukkit
int i2 = this.h(world, i1, k1, j1); for (int i1 = i - 1; i1 <= i + 1; ++i1) {
for (int j1 = k - 1; j1 <= k + 1; ++j1) {
for (int k1 = j - 1; k1 <= j + 4; ++k1) {
if (i1 != i || k1 != j || j1 != k) {
int l1 = 100;
if (i2 > 0 && random.nextInt(l1) <= i2) { if (k1 > j + 1) {
// CraftBukkit start - Call to stop spread of fire. l1 += (k1 - (j + 1)) * 100;
org.bukkit.block.Block theBlock = cworld.getBlockAt(i1, k1, j1);
if (theBlock.getTypeId() != Block.FIRE.id) {
BlockIgniteEvent event = new BlockIgniteEvent(theBlock, igniteCause, thePlayer);
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
continue;
}
} }
// CraftBukkit end
world.setTypeId(i1, k1, j1, this.id); int i2 = this.h(world, i1, k1, j1);
if (i2 > 0 && random.nextInt(l1) <= i2 && (!world.v() || !world.q(i1, k1, j1)) && !world.q(i1 - 1, k1, k) && !world.q(i1 + 1, k1, j1) && !world.q(i1, k1, j1 - 1) && !world.q(i1, k1, j1 + 1)) {
// CraftBukkit start - Call to stop spread of fire.
org.bukkit.block.Block theBlock = cworld.getBlockAt(i1, k1, j1);
if (theBlock.getTypeId() != Block.FIRE.id) {
BlockIgniteEvent event = new BlockIgniteEvent(theBlock, igniteCause, thePlayer);
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
continue;
}
}
// CraftBukkit end
world.setTypeId(i1, k1, j1, this.id);
}
} }
} }
} }
@ -140,7 +145,7 @@ public class BlockFire extends Block {
} }
// CraftBukkit end // CraftBukkit end
if (random.nextInt(2) == 0) { if (random.nextInt(2) == 0 && !world.q(i, j, k)) {
world.setTypeId(i, j, k, this.id); world.setTypeId(i, j, k, this.id);
} else { } else {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
@ -173,7 +178,7 @@ public class BlockFire extends Block {
} }
} }
public boolean d() { public boolean n_() {
return false; return false;
} }