More fixes for projector

master
Bartek Bok 2017-02-26 20:00:55 +01:00
parent 3cf364e9ce
commit 44be1ac9cb
No known key found for this signature in database
GPG Key ID: D4AB7344B821F0B5
2 changed files with 13 additions and 1 deletions

View File

@ -30,8 +30,13 @@ public class BlockProjectorRenderer implements IBlockRenderer<BlockProjector> {
@Override
public void renderInventoryBlock(BlockProjector block, int metadata, int modelID, RenderBlocks renderer) {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
// Block.getRenderBlockPass causes this be false, but only in some codepaths
final boolean depthMaskState = GL11.glGetBoolean(GL11.GL_DEPTH_WRITEMASK);
if (!depthMaskState)
GL11.glDepthMask(true);
RenderUtils.renderInventoryBlock(renderer, block, 0);
if (block.shouldRenderTesrInInventory()) {
@ -41,6 +46,8 @@ public class BlockProjectorRenderer implements IBlockRenderer<BlockProjector> {
TileEntityRendererDispatcher.instance.renderTileEntityAt(renderTe, -0.5, -0.5, -0.5, 0.0F);
}
if (!depthMaskState)
GL11.glDepthMask(false);
}
@Override

View File

@ -77,4 +77,9 @@ public class BlockProjector extends OpenBlock {
public boolean canRenderInPass(int pass) {
return true;
}
@Override
public int getRenderBlockPass() {
return 1;
}
}