From 5624203a18fb2c4c29538532a6d55da8d18a35ac Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 7 Oct 2016 18:01:33 +0200 Subject: Gui and rendering changes from bloodasp code --- src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java') diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index 4c20715e68..b9cae3e0b3 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -29,7 +29,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { super.drawGuiContainerBackgroundLayer(par1, par2, par3); if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) { int tColor = mContainer.mTileEntity.getColorization() & 15; - if (tColor >= 0 && tColor < ItemDye.field_150922_c.length) { + if (tColor < ItemDye.field_150922_c.length) { tColor = ItemDye.field_150922_c[tColor]; GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F); } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- cgit From 756a6b9f63551193b26cd2620196482a8ab99847 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 17 Dec 2016 16:34:55 +0100 Subject: Change dyes again and make machines use the GT Dyes instead of Forge Dyes. (makes gui looks like rendered block) --- .../gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java') diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index b9cae3e0b3..1d71b09a4f 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -1,6 +1,7 @@ package gregtech.api.gui; import gregtech.api.GregTech_API; +import gregtech.api.enums.Dyes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemDye; @@ -28,11 +29,11 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) { - int tColor = mContainer.mTileEntity.getColorization() & 15; - if (tColor < ItemDye.field_150922_c.length) { - tColor = ItemDye.field_150922_c[tColor]; - GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F); - } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + byte colorByte=mContainer.mTileEntity.getColorization(); + Dyes color; + if(colorByte != -1) color= Dyes.get(colorByte); + else color=Dyes.MACHINE_METAL; + GL11.glColor3ub((byte)color.mRGBa[0], (byte)color.mRGBa[1], (byte)color.mRGBa[2]); + } else GL11.glColor3ub((byte)255,(byte)255,(byte)255); } } \ No newline at end of file -- cgit From 74f8aa0533b35035d411179fc05377d63f145a76 Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 15 Mar 2017 18:02:53 +0100 Subject: Optimize imports --- src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java') diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index 1d71b09a4f..9cdb74c2f1 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -4,7 +4,6 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemDye; import org.lwjgl.opengl.GL11; /** -- cgit