From 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sun, 18 Oct 2015 23:04:39 -0400 Subject: Move source directory --- .../api/gui/GT_GUIContainerMetaTile_Machine.java | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java (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 new file mode 100644 index 0000000000..0bfc774bfb --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -0,0 +1,39 @@ +package gregtech.api.gui; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemDye; + +import org.lwjgl.opengl.GL11; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The GUI-Container I use for all my MetaTileEntities + */ +public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { + + public final GT_ContainerMetaTile_Machine mContainer; + + public GT_GUIContainerMetaTile_Machine(GT_ContainerMetaTile_Machine aContainer, String aGUIbackground) { + super(aContainer, aGUIbackground); + mContainer = aContainer; + } + + public GT_GUIContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aGUIbackground) { + this(new GT_ContainerMetaTile_Machine(aInventoryPlayer, aTileEntity), aGUIbackground); + } + + @Override + 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 >= 0 && 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); + } +} \ No newline at end of file -- cgit