aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java')
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java13
1 files changed, 7 insertions, 6 deletions
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