Initialize fluid hardness to match vanilla fluids

This initialises BoP fluids to have a hardness of 100.0F which matches
vanilla water and lava. Calling #setHardness subsequently sets the
blockResistance (blockHardness * 5.0F) which handles resistence to
explosions.

An exception was made for quicksand, which initializes to the same
hardness as minecraft:sand (0.5F) so that explosions won't leave piles
of quicksand floating around.

Signed-off-by: srs-bsns <forfrdm@gmail.com>
This commit is contained in:
srs-bsns 2018-02-21 01:33:04 -05:00
parent c3a4237b83
commit 02bef12c47
No known key found for this signature in database
GPG key ID: 1C182C2CFA44C4AA
5 changed files with 5 additions and 0 deletions

View file

@ -27,6 +27,7 @@ public class BlockBloodFluid extends BlockFluidClassic
{
super(fluid, Material.WATER);
this.setLightOpacity(3);
this.setHardness(100.0F);
}
@Override

View file

@ -33,6 +33,7 @@ public class BlockHoneyFluid extends BlockFluidFinite
this.setLightOpacity(1);
// default state should be a 'full block' of honey
this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, this.quantaPerBlock - 1));
this.setHardness(100.0F);
}
@Override

View file

@ -37,6 +37,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
{
super(fluid, Material.WATER);
this.setLightOpacity(3);
this.setHardness(100.0F);
}
@Override

View file

@ -32,6 +32,7 @@ public class BlockPoisonFluid extends BlockFluidClassic
super(fluid, Material.WATER);
this.setLightOpacity(3);
this.quantaPerBlock = 4;
this.setHardness(100.0F);
}
@Override

View file

@ -32,6 +32,7 @@ public class BlockQuicksandFluid extends BlockFluidClassic
this.quantaPerBlock = 3;
this.setLightOpacity(255);
this.renderLayer = BlockRenderLayer.SOLID;
this.setHardness(0.5F);// match the hardness of vanilla sand
}
@Override