aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/client/gui/Gui_ItemProxySource.java
diff options
context:
space:
mode:
authorChristina Berchtold <kekzdealer@gmail.com>2020-04-29 10:23:20 +0200
committerChristina Berchtold <kekzdealer@gmail.com>2020-04-29 10:23:20 +0200
commitfea89499d449a215b0b9ec3012b76c0ef35815f5 (patch)
tree1a322995da55dd03e3617ef574add129c1910433 /src/main/java/client/gui/Gui_ItemProxySource.java
parentea59908cdcaa0569994498e5c029bf4ab4eed288 (diff)
downloadGT5-Unofficial-fea89499d449a215b0b9ec3012b76c0ef35815f5.tar.gz
GT5-Unofficial-fea89499d449a215b0b9ec3012b76c0ef35815f5.tar.bz2
GT5-Unofficial-fea89499d449a215b0b9ec3012b76c0ef35815f5.zip
split gui-/containers into client/common packages
Diffstat (limited to 'src/main/java/client/gui/Gui_ItemProxySource.java')
-rw-r--r--src/main/java/client/gui/Gui_ItemProxySource.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/client/gui/Gui_ItemProxySource.java b/src/main/java/client/gui/Gui_ItemProxySource.java
new file mode 100644
index 0000000000..a811f01bbe
--- /dev/null
+++ b/src/main/java/client/gui/Gui_ItemProxySource.java
@@ -0,0 +1,51 @@
+package client.gui;
+
+import org.lwjgl.opengl.GL11;
+
+import common.container.Container_ItemProxySource;
+import kekztech.KekzCore;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+
+public class Gui_ItemProxySource extends GuiContainer {
+
+ private final ResourceLocation texture = new ResourceLocation(KekzCore.MODID, "textures/gui/ItemTech4by4.png");
+
+ private final InventoryPlayer inventory;
+ private final IInventory te;
+
+ public Gui_ItemProxySource(TileEntity te, EntityPlayer player) {
+ super(new Container_ItemProxySource(te, player));
+ inventory = player.inventory;
+ this.te = (IInventory) te;
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
+
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+
+ final int x = (super.width - super.xSize) / 2;
+ final int y = (super.height - super.ySize) / 2;
+
+ super.drawTexturedModalRect(x, y, 0, 0, super.xSize, super.ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int p1, int p2) {
+ super.fontRendererObj.drawString(
+ I18n.format(te.getInventoryName()),
+ (super.xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2),
+ 6, 4210752, false);
+ super.fontRendererObj.drawString(
+ I18n.format(inventory.getInventoryName()), 8, super.ySize - 96 + 2, 4210752);
+ }
+}