@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderBlocks) {
boolean rendered = false;
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileSlab) {
TileSlab slab = (TileSlab) tile;
if (slab.getTopSlab() != null && slab.getTopSlab() == slab.getBottomSlab()) {
if (canRenderInPass(renderBlocks, slab.getTopSlab())) {
BlockRailcraftSlab.textureSlab = slab.getTopSlab();
renderBlocks.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
renderBlocks.renderStandardBlock(block, x, y, z);
BlockRailcraftSlab.textureSlab = null;
rendered = true;
}
} else {
if (slab.getTopSlab() != null)
if (canRenderInPass(renderBlocks, slab.getTopSlab())) {
BlockRailcraftSlab.textureSlab = slab.getTopSlab();
renderBlocks.setRenderBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderBlocks.renderStandardBlock(block, x, y, z);
BlockRailcraftSlab.textureSlab = null;
rendered = true;
}
if (slab.getBottomSlab() != null)
if (canRenderInPass(renderBlocks, slab.getBottomSlab())) {
BlockRailcraftSlab.textureSlab = slab.getBottomSlab();
renderBlocks.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderBlocks.renderStandardBlock(block, x, y, z);
BlockRailcraftSlab.textureSlab = null;
rendered = true;
}