fixed the winter's calling creating snow in invalid locations

Closes #138
This commit is contained in:
Ell 2020-09-02 21:36:08 +02:00
parent 1ccdc83c1f
commit 8f9e4df351

View file

@ -54,7 +54,7 @@ public class TileEntitySnowCreator extends TileEntityImpl implements ITickableTi
Fluid fluid = this.world.getFluidState(down).getFluid(); Fluid fluid = this.world.getFluidState(down).getFluid();
if (fluid == Fluids.WATER) { if (fluid == Fluids.WATER) {
this.world.setBlockState(down, Blocks.ICE.getDefaultState()); this.world.setBlockState(down, Blocks.ICE.getDefaultState());
} else if (Blocks.SNOW.getDefaultState().isValidPosition(this.world, pos) && this.world.getBlockState(pos).getBlock() != Blocks.SNOW) { } else if (Blocks.SNOW.getDefaultState().isValidPosition(this.world, pos) && this.world.getBlockState(pos).getBlock() != Blocks.SNOW && this.world.getBlockState(pos).getMaterial().isReplaceable()) {
this.world.setBlockState(pos, Blocks.SNOW.getDefaultState()); this.world.setBlockState(pos, Blocks.SNOW.getDefaultState());
if (this.snowmanCount < range / 2 && this.world.rand.nextFloat() >= 0.995F) { if (this.snowmanCount < range / 2 && this.world.rand.nextFloat() >= 0.995F) {