Fix waterlogged bracketed kinetics dropping the bracket (#7126)

This commit is contained in:
IThundxr 2025-01-10 12:05:37 -05:00 committed by GitHub
parent b420e3a3b7
commit 1d403a5562
Failed to generate hash of commit

View file

@ -37,7 +37,10 @@ public abstract class AbstractSimpleShaftBlock extends AbstractShaftBlock implem
@Override
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean isMoving) {
if (state != newState && !isMoving)
boolean wasWaterLogged = state.hasProperty(WATERLOGGED) &&
newState.hasProperty(WATERLOGGED) &&
(state.getValue(WATERLOGGED) != newState.getValue(WATERLOGGED));
if (state != newState && !isMoving && !wasWaterLogged)
removeBracket(world, pos, true).ifPresent(stack -> Block.popResource(world, pos, stack));
super.onRemove(state, world, pos, newState, isMoving);
}