aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
diff options
context:
space:
mode:
authorShawn Buckley <shawntbuckley@gmail.com>2015-10-18 23:04:39 -0400
committerShawn Buckley <shawntbuckley@gmail.com>2015-10-18 23:04:39 -0400
commit85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch)
treecb302d8e0f46e06be0b1d391317578b165aec245 /src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
parentce25063b910bb3bdd2b0c234b185fc4077caebdb (diff)
downloadGT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz
GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2
GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip
Move source directory
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.java39
1 files changed, 39 insertions, 0 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
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