From 17ae09fb138b8f73fc28355130d16b363a1c05d7 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Sun, 23 May 2021 16:42:33 +0200 Subject: fix(render): grass block top grey in inventory --- .../gregtech/common/render/GT_Renderer_Block.java | 39 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java index 42e59dd2c7..a9eafd7854 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java @@ -453,8 +453,6 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aRenderer.enableAO = false; aRenderer.useInventoryTint = true; - Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); @@ -464,18 +462,30 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API } else if (aMeta > 0 && (aMeta < GregTech_API.METATILEENTITIES.length) @@ -488,7 +498,6 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API GL11.glTranslatef(0.5F, 0.5F, 0.5F); aRenderer.useInventoryTint = false; } @@ -513,31 +522,55 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, blockMax, pipeMax, pipeMax); aRenderer.setRenderBoundsFromBlock(aBlock); + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API } else { + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API } } -- cgit