aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/render
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-08 22:31:58 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:38:39 +0200
commit04468545985a4fed401d9b6626670e8af5938920 (patch)
tree1941b545ac1e07ea64a605911ca245b5e836d56d /src/main/java/gregtech/common/render
parent9fcbc16e436ef745d761cb934834d8070fb68a8c (diff)
downloadGT5-Unofficial-04468545985a4fed401d9b6626670e8af5938920.tar.gz
GT5-Unofficial-04468545985a4fed401d9b6626670e8af5938920.tar.bz2
GT5-Unofficial-04468545985a4fed401d9b6626670e8af5938920.zip
fix(render): move new textures rendering to new package
Old textures rendering are kept in api/objects for backward compatibility. The old textures rendering does not handle glow textures or independant inventory tessellation. The old textures will only work with the old GT_Renderer_Block class New textures rendering with own tessellation in inventory and handling of glow emisssive textures are moved to the api/render package. These must not be used with the Old GT_Renderer_Block class or it will crash with: Already Tessellating Exception from the Tessellator class
Diffstat (limited to 'src/main/java/gregtech/common/render')
-rw-r--r--src/main/java/gregtech/common/render/GT_Renderer_Block.java17
1 files changed, 10 insertions, 7 deletions
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 0e3730098d..eb439b4e3e 100644
--- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java
+++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java
@@ -448,6 +448,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
return true;
}
+ @Override
public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
aRenderer.enableAO = false;
aRenderer.useInventoryTint = true;
@@ -467,13 +468,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true);
renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true);
renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true);
- } else {
- if ((aMeta > 0)
- && (aMeta < GregTech_API.METATILEENTITIES.length)
- && (GregTech_API.METATILEENTITIES[aMeta] != null)
- && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) {
- renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer);
- }
+ } else if (aMeta > 0
+ && (aMeta < GregTech_API.METATILEENTITIES.length)
+ && aBlock instanceof GT_Block_Machines
+ && (GregTech_API.METATILEENTITIES[aMeta] != null)
+ && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) {
+ renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer);
}
aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax);
@@ -597,6 +597,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
+ @Override
public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion;
aRenderer.useInventoryTint = false;
@@ -622,10 +623,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
return false;
}
+ @Override
public boolean shouldRender3DInInventory(int aModel) {
return true;
}
+ @Override
public int getRenderId() {
return this.mRenderID;
}