The Aether

The Aether

35M Downloads

Bug: Spam-placing Aerogel Stairs causes block renders to stop updating

bconlon1 opened this issue ยท 2 comments

commented

Attempting to close the game also fails.

commented

Caused by this method:

/**
* [CODE COPY] - {@link Block#hidesNeighborFace(BlockGetter, BlockPos, BlockState, BlockState, Direction)}.
*/
@Override
public boolean hidesNeighborFace(BlockGetter level, BlockPos pos, BlockState state, BlockState neighborState, Direction direction) {
if (neighborState.is(this)) {
Block.BlockStatePairKey blockStatePairKey = new BlockStatePairKey(neighborState, state, direction.getOpposite());
Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey> occlusionCache = OCCLUSION_CACHE.get();
byte cacheByte = occlusionCache.getAndMoveToFirst(blockStatePairKey);
if (cacheByte != 127) {
return cacheByte != 0;
}
VoxelShape neighborShape = neighborState.getFaceOcclusionShape(level, pos.relative(direction), direction.getOpposite());
if (neighborShape.isEmpty()) {
return false;
}
VoxelShape shape = state.getFaceOcclusionShape(level, pos, direction);
boolean differing = !Shapes.joinIsNotEmpty(neighborShape, shape, BooleanOp.ONLY_FIRST);
if (occlusionCache.size() == 2048) {
occlusionCache.removeLastByte();
}
occlusionCache.putAndMoveToFirst(blockStatePairKey, (byte) (differing ? 1 : 0));
return differing;
}
return super.hidesNeighborFace(level, pos, state, neighborState, direction);
}
}

commented

According to the docs, the only idea as to why this might happen is from a ConcurrentModificationException. This method should probably be replaced with skipRendering() if possible. Rendering will only be skipped for connecting stair blocks, non-connecting ones like an upside down one next to a regular one won't skip rendering because it'd be too hard.