aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java161
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_BronzeWorkbench.java161
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_BronzeWorkbench.java30
4 files changed, 382 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java
new file mode 100644
index 0000000000..bb7982afe3
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java
@@ -0,0 +1,161 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_AdvancedWorkbench
+extends GT_ContainerMetaTile_Machine
+{
+ public CONTAINER_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity)
+ {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer)
+ {
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 2, 44, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 3, 62, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 4, 8, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 5, 26, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 6, 44, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 7, 62, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 8, 8, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 9, 26, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 10, 44, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 11, 62, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 12, 8, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 13, 26, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 14, 44, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 15, 62, 62));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 16, 82, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 17, 100, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 18, 118, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 19, 136, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 20, 154, 8));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 21, 82, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 22, 100, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 23, 118, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 24, 82, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 25, 100, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 26, 118, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 27, 82, 64));
+ addSlotToContainer(new Slot(this.mTileEntity, 28, 100, 64));
+ addSlotToContainer(new Slot(this.mTileEntity, 29, 118, 64));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 33, 154, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 34, 154, 64));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 30, 136, 28));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 31, 136, 64, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 32, 154, 46, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 32, 136, 46, false, false, 1));
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer)
+ {
+ if ((aSlotIndex < 21) || (aSlotIndex > 35)) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ if ((this.mTileEntity == null) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return null;
+ }
+ try
+ {
+ ItemStack tStack = ((Slot)this.inventorySlots.get(aSlotIndex)).getStack();
+ if ((tStack != null) && (tStack.stackSize <= 0) && (!GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack()))) {
+ return null;
+ }
+ if (aSlotIndex == 32)
+ {
+ if ((aMouseclick == 0) && (aShifthold == 1))
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).setBluePrint(null);
+ return null;
+ }
+ }
+ else
+ {
+ if (aSlotIndex == 33)
+ {
+ ItemStack tCraftedStack = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput();
+ if (tCraftedStack != null) {
+ if (aShifthold == 1)
+ {
+ for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i = (byte)(i + 1)) {
+ for (byte j = 0; (j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize) && (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()); j = (byte)(j + 1))
+ {
+ ItemStack tStack2;
+ if ((!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack)) || ((tStack != null) && (tStack.stackSize != tStack2.stackSize))) {
+ return aPlayer.inventory.getItemStack();
+ }
+ aPlayer.inventory.mainInventory[i] = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]);
+ }
+ }
+ }
+ else
+ {
+ if (aMouseclick == 0)
+ {
+ if (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) {
+ aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ for (int i = 0; (i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize) && (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()); i++)
+ {
+ ItemStack tStack2;
+ if ((!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack)) || ((tStack != null) && (tStack.stackSize != tStack2.stackSize))) {
+ return aPlayer.inventory.getItemStack();
+ }
+ aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ }
+ return null;
+ }
+ if (aSlotIndex == 34)
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).mFlushMode = true;
+ return null;
+ }
+ if (aSlotIndex == 35)
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
+ return null;
+ }
+ }
+ }
+ catch (Throwable e)
+ {
+ e.printStackTrace(GT_Log.err);
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public int getSlotCount()
+ {
+ return 33;
+ }
+
+ @Override
+ public int getShiftClickSlotCount()
+ {
+ return 21;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_BronzeWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_BronzeWorkbench.java
new file mode 100644
index 0000000000..d093101044
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_BronzeWorkbench.java
@@ -0,0 +1,161 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_BronzeWorkbench
+extends GT_ContainerMetaTile_Machine
+{
+ public CONTAINER_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity)
+ {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer)
+ {
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 2, 44, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 3, 62, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 4, 8, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 5, 26, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 6, 44, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 7, 62, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 8, 8, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 9, 26, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 10, 44, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 11, 62, 44));
+ addSlotToContainer(new Slot(this.mTileEntity, 12, 8, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 13, 26, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 14, 44, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 15, 62, 62));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 16, 82, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 17, 100, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 18, 118, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 19, 136, 8));
+ addSlotToContainer(new Slot(this.mTileEntity, 20, 154, 8));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 21, 82, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 22, 100, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 23, 118, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 24, 82, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 25, 100, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 26, 118, 46));
+ addSlotToContainer(new Slot(this.mTileEntity, 27, 82, 64));
+ addSlotToContainer(new Slot(this.mTileEntity, 28, 100, 64));
+ addSlotToContainer(new Slot(this.mTileEntity, 29, 118, 64));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 33, 154, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 34, 154, 64));
+
+ addSlotToContainer(new Slot(this.mTileEntity, 30, 136, 28));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 31, 136, 64, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 32, 154, 46, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 32, 136, 46, false, false, 1));
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer)
+ {
+ if ((aSlotIndex < 21) || (aSlotIndex > 35)) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ if ((this.mTileEntity == null) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return null;
+ }
+ try
+ {
+ ItemStack tStack = ((Slot)this.inventorySlots.get(aSlotIndex)).getStack();
+ if ((tStack != null) && (tStack.stackSize <= 0) && (!GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack()))) {
+ return null;
+ }
+ if (aSlotIndex == 32)
+ {
+ if ((aMouseclick == 0) && (aShifthold == 1))
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).setBluePrint(null);
+ return null;
+ }
+ }
+ else
+ {
+ if (aSlotIndex == 33)
+ {
+ ItemStack tCraftedStack = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput();
+ if (tCraftedStack != null) {
+ if (aShifthold == 1)
+ {
+ for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i = (byte)(i + 1)) {
+ for (byte j = 0; (j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize) && (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()); j = (byte)(j + 1))
+ {
+ ItemStack tStack2;
+ if ((!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack)) || ((tStack != null) && (tStack.stackSize != tStack2.stackSize))) {
+ return aPlayer.inventory.getItemStack();
+ }
+ aPlayer.inventory.mainInventory[i] = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]);
+ }
+ }
+ }
+ else
+ {
+ if (aMouseclick == 0)
+ {
+ if (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) {
+ aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ for (int i = 0; (i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize) && (((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).canDoCraftingOutput()); i++)
+ {
+ ItemStack tStack2;
+ if ((!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack)) || ((tStack != null) && (tStack.stackSize != tStack2.stackSize))) {
+ return aPlayer.inventory.getItemStack();
+ }
+ aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ }
+ return null;
+ }
+ if (aSlotIndex == 34)
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).mFlushMode = true;
+ return null;
+ }
+ if (aSlotIndex == 35)
+ {
+ ((GT_MetaTileEntity_AdvancedCraftingTable)this.mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
+ return null;
+ }
+ }
+ }
+ catch (Throwable e)
+ {
+ e.printStackTrace(GT_Log.err);
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public int getSlotCount()
+ {
+ return 33;
+ }
+
+ @Override
+ public int getShiftClickSlotCount()
+ {
+ return 21;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java
new file mode 100644
index 0000000000..7da9238bd5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_AdvancedWorkbench
+extends GT_GUIContainerMetaTile_Machine
+{
+ public GUI_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity)
+ {
+ super(new CONTAINER_AdvancedWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "AdvancedCraftingTable.png");
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ //this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_BronzeWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_BronzeWorkbench.java
new file mode 100644
index 0000000000..597edba503
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_BronzeWorkbench.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_BronzeWorkbench
+extends GT_GUIContainerMetaTile_Machine
+{
+ public GUI_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity)
+ {
+ super(new CONTAINER_BronzeWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "BronzeCraftingTable.png");
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ //this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}