Fixed hull glass lighting and rendering properties

- should not cast shadows
- place doors away from the hull
- support blocks on top (pressure plate notably)
- reduce rendering overhead
This commit is contained in:
Unknown 2019-06-08 13:13:20 +02:00 committed by unknown
parent a361b0b4cf
commit c70571e44d

View file

@ -61,6 +61,27 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR
return false; return false;
} }
// return true to support pressure plates, etc. since it's glass material
@SuppressWarnings("deprecation")
@Override
public boolean isTopSolid(final IBlockState blockState) {
return true;
}
// return false to give full rendering transparency (but loose vertical redstone wire)
@SuppressWarnings("deprecation")
@Override
public boolean isBlockNormalCube(final IBlockState blockState) {
return false;
}
// return true to give proper door placement since it's glass material
@SuppressWarnings("deprecation")
@Override
public boolean isNormalCube(final IBlockState blockState) {
return true;
}
@Nonnull @Nonnull
@Override @Override
public EnumTier getTier(final ItemStack itemStack) { public EnumTier getTier(final ItemStack itemStack) {
@ -85,12 +106,6 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR
// no operation // no operation
} }
@SuppressWarnings("deprecation")
@Override
public boolean isTranslucent(final IBlockState blockState) {
return true;
}
@Nonnull @Nonnull
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
@ -101,13 +116,13 @@ public class BlockHullGlass extends BlockColored implements IBlockBase, IDamageR
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public boolean shouldSideBeRendered(final IBlockState blockState, @Nonnull final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos, final EnumFacing facing) { public boolean shouldSideBeRendered(@Nonnull final IBlockState blockState, @Nonnull final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos, @Nonnull final EnumFacing facing) {
final BlockPos blockPosSide = blockPos.offset(facing); final BlockPos blockPosSide = blockPos.offset(facing);
if (blockAccess.isAirBlock(blockPosSide)) { final IBlockState blockStateSide = blockAccess.getBlockState(blockPosSide);
if (blockStateSide.getBlock().isAir(blockStateSide, blockAccess, blockPosSide)) {
return true; return true;
} }
final EnumFacing opposite = facing.getOpposite(); final EnumFacing opposite = facing.getOpposite();
final IBlockState blockStateSide = blockAccess.getBlockState(blockPosSide);
if ( blockStateSide.getBlock() instanceof BlockGlass if ( blockStateSide.getBlock() instanceof BlockGlass
|| blockStateSide.getBlock() instanceof BlockHullGlass ) { || blockStateSide.getBlock() instanceof BlockHullGlass ) {
return blockState.getBlock().getMetaFromState(blockState) return blockState.getBlock().getMetaFromState(blockState)