From 02bef12c47422543088afece748bd96ca3d81001 Mon Sep 17 00:00:00 2001 From: srs-bsns Date: Wed, 21 Feb 2018 01:33:04 -0500 Subject: [PATCH] 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 --- .../java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java | 1 + .../java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java | 1 + .../common/fluids/blocks/BlockHotSpringWaterFluid.java | 1 + .../biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java | 1 + .../biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java | 1 + 5 files changed, 5 insertions(+) diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java index 7089c80d0..78308573b 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java @@ -27,6 +27,7 @@ public class BlockBloodFluid extends BlockFluidClassic { super(fluid, Material.WATER); this.setLightOpacity(3); + this.setHardness(100.0F); } @Override diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java index 8d7832b0c..0a27271a4 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java @@ -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 diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java index ab3bbdea7..2eb9ea3ce 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java @@ -37,6 +37,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic { super(fluid, Material.WATER); this.setLightOpacity(3); + this.setHardness(100.0F); } @Override diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java index 695fb14af..85036420a 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java @@ -32,6 +32,7 @@ public class BlockPoisonFluid extends BlockFluidClassic super(fluid, Material.WATER); this.setLightOpacity(3); this.quantaPerBlock = 4; + this.setHardness(100.0F); } @Override diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java index 358508133..4e7066919 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java @@ -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