1
0
Fork 0

fix explosions not destroying liquids

This commit is contained in:
Sen 2025-08-27 12:37:09 +02:00
parent 3a77bb8551
commit 11db0e57cb
Signed by: sen
GPG key ID: 3AC50A6F47D1B722

View file

@ -107,7 +107,7 @@ public class Explosion
(dist < radius && rand.doublev() + ((dist - (radius - falloff)) / falloff) < 1.0d))) {
BlockPos pos = new BlockPos(explosionX + x, explosionY + y, explosionZ + z);
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))
state.getBlock().drop(world, pos, state, 1.0F / (float)radius, 0);
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)) {
BlockPos pos = new BlockPos(this.explosionX + x, this.explosionY + y, this.explosionZ + z);
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);
}
}