fix explosions not destroying liquids
This commit is contained in:
parent
3a77bb8551
commit
11db0e57cb
1 changed files with 2 additions and 2 deletions
|
@ -107,7 +107,7 @@ public class Explosion
|
||||||
(dist < radius && rand.doublev() + ((dist - (radius - falloff)) / falloff) < 1.0d))) {
|
(dist < radius && rand.doublev() + ((dist - (radius - falloff)) / falloff) < 1.0d))) {
|
||||||
BlockPos pos = new BlockPos(explosionX + x, explosionY + y, explosionZ + z);
|
BlockPos pos = new BlockPos(explosionX + x, explosionY + y, explosionZ + z);
|
||||||
State state = world.getState(pos);
|
State state = world.getState(pos);
|
||||||
if(state.getBlock() != Blocks.air && (float)radius - (state.getBlock().getResistance() / 5.0F + 0.3F) * 0.3F > 0.0f) {
|
if(state.getBlock() != Blocks.air && (state.getBlock().getMaterial().isLiquid() || (float)radius - (state.getBlock().getResistance() / 5.0F + 0.3F) * 0.3F > 0.0f)) {
|
||||||
if(state.getBlock().canDrop(null))
|
if(state.getBlock().canDrop(null))
|
||||||
state.getBlock().drop(world, pos, state, 1.0F / (float)radius, 0);
|
state.getBlock().drop(world, pos, state, 1.0F / (float)radius, 0);
|
||||||
world.setState(pos, Blocks.air.getState(), radius < 40.0 ? 2 : 10);
|
world.setState(pos, Blocks.air.getState(), radius < 40.0 ? 2 : 10);
|
||||||
|
@ -158,7 +158,7 @@ public class Explosion
|
||||||
(dist < this.explosionSize && this.explosionRNG.doublev() + ((dist - (this.explosionSize - falloff)) / falloff) < 1.0d)) {
|
(dist < this.explosionSize && this.explosionRNG.doublev() + ((dist - (this.explosionSize - falloff)) / falloff) < 1.0d)) {
|
||||||
BlockPos pos = new BlockPos(this.explosionX + x, this.explosionY + y, this.explosionZ + z);
|
BlockPos pos = new BlockPos(this.explosionX + x, this.explosionY + y, this.explosionZ + z);
|
||||||
State state = this.worldObj.getState(pos);
|
State state = this.worldObj.getState(pos);
|
||||||
if(state.getBlock() != Blocks.air && this.explosionSize - (state.getBlock().getResistance() / 5.0F + 0.3F) * 0.3F > 0.0F)
|
if(state.getBlock() != Blocks.air && (state.getBlock().getMaterial().isLiquid() || this.explosionSize - (state.getBlock().getResistance() / 5.0F + 0.3F) * 0.3F > 0.0F))
|
||||||
set.add(pos);
|
set.add(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue