Change dyes again and make machines use the GT Dyes instead of Forge Dyes. (makes gui looks like rendered block)

This commit is contained in:
Technus 2016-12-17 16:34:55 +01:00
parent 6eed47cfaa
commit 756a6b9f63
2 changed files with 8 additions and 7 deletions

View file

@ -24,7 +24,7 @@ public enum Dyes implements IColorModulationContainer {
dyePink(9, 255, 192, 192, "Pink"),
dyeLime(10, 128, 255, 128, "Lime"),
dyeYellow(11, 255, 255, 0, "Yellow"),
dyeLightBlue(12, 128, 128, 255, "Light Blue"),
dyeLightBlue(12, 96, 128, 255, "Light Blue"),
dyeMagenta(13, 255, 0, 255, "Magenta"),
dyeOrange(14, 255, 128, 0, "Orange"),
dyeWhite(15, 255, 255, 255, "White"),

View file

@ -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);
}
}