Skip to content

Commit

Permalink
Allow Thermal Calcite Vents to produce steam without a water block ab…
Browse files Browse the repository at this point in the history
…ove (Closes #2172)
  • Loading branch information
Forstride committed Jan 31, 2024
1 parent 58c4db5 commit c802a3b
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.pathfinder.PathComputationType;

public class ThermalCalciteVentBlock extends ThermalCalciteBlock
Expand All @@ -27,12 +26,9 @@ public ThermalCalciteVentBlock(Properties properties)
@Override
public void stepOn(Level level, BlockPos p_153778_, BlockState p_153779_, Entity p_153780_)
{
if (level.getBlockState(p_153778_.above()).getFluidState().getType() == Fluids.WATER && level.getBlockState(p_153778_.above()).getFluidState().getAmount() == 8)
if (!p_153780_.fireImmune() && p_153780_ instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) p_153780_))
{
if (!p_153780_.fireImmune() && p_153780_ instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) p_153780_))
{
p_153780_.hurt(level.damageSources().source(BOPDamageTypes.FUMAROLE), 1.0F);
}
p_153780_.hurt(level.damageSources().source(BOPDamageTypes.FUMAROLE), 1.0F);
}

super.stepOn(level, p_153778_, p_153779_, p_153780_);
Expand All @@ -42,10 +38,7 @@ public void stepOn(Level level, BlockPos p_153778_, BlockState p_153779_, Entity
public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand)
{
super.animateTick(stateIn, worldIn, pos, rand);
if (worldIn.getBlockState(pos.above()).getFluidState().getType() == Fluids.WATER && worldIn.getBlockState(pos.above()).getFluidState().getAmount() == 8)
{
worldIn.addAlwaysVisibleParticle(ModParticles.STEAM, (double) (pos.getX() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), (double) (pos.getY() + 1.0D), (double) (pos.getZ() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), 0.0D, 0.02D, 0.0D);
}
worldIn.addAlwaysVisibleParticle(ModParticles.STEAM, (double) (pos.getX() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), (double) (pos.getY() + 1.0D), (double) (pos.getZ() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), 0.0D, 0.02D, 0.0D);
}

@Override
Expand Down

0 comments on commit c802a3b

Please sign in to comment.