Make monitors "properly" solid blocks

This fixes monitor rendering underwater (closes #314). By default,
isSolid returns true if the render layer is SOLID. As we use CUTOUT due
to our funky TE rendering, we need to override this to return true
anyway.

This will cause some side effects, as monitors now blocking light
propagation, but I don't think that's the end of the world.
This commit is contained in:
SquidDev 2019-11-23 10:31:55 +00:00
parent 927ddb0bde
commit be6dd21e54
1 changed files with 9 additions and 0 deletions

View File

@ -49,9 +49,18 @@ public BlockMonitor( Properties settings, NamedTileEntityType<? extends TileGene
@Override
public BlockRenderLayer getRenderLayer()
{
// We use the CUTOUT layer, as otherwise monitor rendering will cause flickering.
return BlockRenderLayer.CUTOUT;
}
@Override
@Deprecated
public boolean isSolid( BlockState p_200124_1_ )
{
// We override isSolid, as our overriding of getRenderLayer means that it would otherwise return false.
return true;
}
@Override
protected void fillStateContainer( StateContainer.Builder<Block, BlockState> builder )
{