Skip to content

Commit

Permalink
Merge pull request #234 from Anoyomouse/fix_ice_chests
Browse files Browse the repository at this point in the history
Stop converting chests to ice
  • Loading branch information
MichaelHillcox authored Nov 13, 2023
2 parents b389e78 + f74b22b commit 7299417
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,20 @@ private int replaceBlockWithAlternative(Level world, BlockPos pos, BlockState st

// If the block is just water logged, remove the fluid
BlockState blockState = world.getBlockState(pos);
if (blockState.hasProperty(BlockStateProperties.WATERLOGGED) && blockState.getValue(BlockStateProperties.WATERLOGGED) && world.getBlockEntity(pos) == null) {
// Chests have a tile entity, and are then converted to ice below, we need them to lose waterlogged
if (blockState.hasProperty(BlockStateProperties.WATERLOGGED) && blockState.getValue(BlockStateProperties.WATERLOGGED)) {
world.setBlockAndUpdate(pos, blockState.setValue(BlockStateProperties.WATERLOGGED, false));
return costOfOperation;
}

world.setBlockAndUpdate(pos, state);
return costOfOperation;
if (world.getBlockEntity(pos) == null)
{
world.setBlockAndUpdate(pos, state);
return costOfOperation;
}

// Block is a block entity, we don't replace it, costs zero
return 0;
}

public void spawnParticle() {
Expand Down

0 comments on commit 7299417

Please sign in to comment.