1
0
Fork 0

fix block hardness + sounds

This commit is contained in:
Sen 2025-09-10 14:13:10 +02:00
parent 9f9a2e9399
commit 2504f24b7b
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
20 changed files with 70 additions and 54 deletions

View file

@ -939,7 +939,7 @@ public final class WorldServer extends AWorldServer {
private boolean destroyBlock(LocalPos pos, float power, EntityLiving source) {
State state = this.getState(pos);
Block block = state.getBlock();
if(block != Blocks.air && (block.getMaterial().isLiquid() || power - (block.getRawHardness() + 0.3F) * 0.3F > 0.0F)) {
if(block != Blocks.air && (block.getMaterial().isLiquid() || power - ((float)block.getHardness() + 0.3F) * 0.3F > 0.0F)) {
if(block.canExplosionDrop() && this.rand.floatv() <= 1.0F / (power * power))
block.drop(this, pos, state, 0);
this.setState(pos, Blocks.air.getState(), 2);