aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches
diff options
context:
space:
mode:
authoriouter <62897714+iouter@users.noreply.github.com>2022-01-07 12:36:06 +0800
committerGitHub <noreply@github.com>2022-01-07 12:36:06 +0800
commit0834d4b8b45a881f36ed5b295ac0fb38df49fa9a (patch)
tree6fb4a45cf17dd22748148417bc7bb0efb850cea3 /src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches
parentea1439a4195c8f77c45625ea2593a232bf19984e (diff)
parent9b2e050151ad93170e84321d067d1e9d4ded4ba5 (diff)
downloadGT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.gz
GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.bz2
GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.zip
Merge branch 'GTNewHorizons:master' into master
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java32
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java44
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java282
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java59
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java24
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java37
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java22
12 files changed, 689 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
new file mode 100644
index 0000000000..e6203823b6
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
@@ -0,0 +1,60 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_1by1_Turbine extends GT_Container_1by1 {
+
+ public CONTAINER_1by1_Turbine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new SlotTurbine(mTileEntity, 0, 80, 35));
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public boolean canDragIntoSlot(Slot par1Slot) {
+ return false;
+ }
+
+ public class SlotTurbine extends Slot {
+ public SlotTurbine(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (itemstack.getItemDamage() >= 170 && itemstack.getItemDamage() <= 176) {
+ return true;
+ }
+ }
+ return false;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ @Override
+ public boolean canTakeStack(EntityPlayer p_82869_1_) {
+ return false;
+ }
+ @Override
+ public void putStack(ItemStack p_75215_1_) {
+ // TODO Auto-generated method stub
+ super.putStack(p_75215_1_);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
new file mode 100644
index 0000000000..1d396811c1
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class CONTAINER_2by2 extends GT_ContainerMetaTile_Machine {
+
+ public CONTAINER_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 71, 26));
+ addSlotToContainer(new Slot(mTileEntity, 1, 89, 26));
+ addSlotToContainer(new Slot(mTileEntity, 2, 71, 44));
+ addSlotToContainer(new Slot(mTileEntity, 3, 89, 44));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 4;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 4;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
new file mode 100644
index 0000000000..8efe60a06e
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
@@ -0,0 +1,44 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class CONTAINER_4by4 extends GT_ContainerMetaTile_Machine {
+
+ public CONTAINER_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 53, 8));
+ addSlotToContainer(new Slot(mTileEntity, 1, 71, 8));
+ addSlotToContainer(new Slot(mTileEntity, 2, 89, 8));
+ addSlotToContainer(new Slot(mTileEntity, 3, 107, 8));
+ addSlotToContainer(new Slot(mTileEntity, 4, 53, 26));
+ addSlotToContainer(new Slot(mTileEntity, 5, 71, 26));
+ addSlotToContainer(new Slot(mTileEntity, 6, 89, 26));
+ addSlotToContainer(new Slot(mTileEntity, 7, 107, 26));
+ addSlotToContainer(new Slot(mTileEntity, 8, 53, 44));
+ addSlotToContainer(new Slot(mTileEntity, 9, 71, 44));
+ addSlotToContainer(new Slot(mTileEntity, 10, 89, 44));
+ addSlotToContainer(new Slot(mTileEntity, 11, 107, 44));
+ addSlotToContainer(new Slot(mTileEntity, 12, 53, 62));
+ addSlotToContainer(new Slot(mTileEntity, 13, 71, 62));
+ addSlotToContainer(new Slot(mTileEntity, 14, 89, 62));
+ addSlotToContainer(new Slot(mTileEntity, 15, 107, 62));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 16;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 16;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java
new file mode 100644
index 0000000000..9596d41387
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java
@@ -0,0 +1,282 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import java.util.Iterator;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.gui.GT_Container;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.slots.SlotNoInput;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_HatchNbtConsumable extends GT_Container {
+
+ public final int mInputslotCount;
+ private final int mTotalSlotCount;
+
+ public CONTAINER_HatchNbtConsumable(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aInputslotCount) {
+ super(aInventoryPlayer, aTileEntity);
+ mInputslotCount = aInputslotCount;
+ mTotalSlotCount = aInputslotCount*2;
+ mTileEntity = aTileEntity;
+ if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) {
+ addSlots(aInventoryPlayer);
+ if (doesBindPlayerInventory()) {
+ bindPlayerInventory(aInventoryPlayer);
+ }
+ detectAndSendChanges();
+ } else {
+ aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
+ }
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ if (mTotalSlotCount == 8) {
+ final int aSlotYStart = 26;
+ final int aSlotYFinish = aSlotYStart + (18*2);
+ final int aSlotXStart1 = 26;
+ final int aSlotXFinish1 = aSlotXStart1 + (18*2);
+ final int aSlotXStart2 = 116;
+ final int aSlotXFinish2 = aSlotXStart2 + (18*2);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ }
+ else if (mTotalSlotCount == 18) {
+ int aSlotYStart = 20;
+ int aSlotYFinish = aSlotYStart + (18*3);
+ int aSlotXStart1 = 26;
+ int aSlotXFinish1 = aSlotXStart1 + (18*3);
+ int aSlotXStart2 = 98;
+ int aSlotXFinish2 = aSlotXStart2 + (18*3);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ }
+ else if (mTotalSlotCount == 32) {
+ int aSlotYStart = 8;
+ int aSlotYFinish = aSlotYStart + (18*4);
+ int aSlotXStart1 = 8;
+ int aSlotXFinish1 = aSlotXStart1 + (18*4);
+ int aSlotXStart2 = 97;
+ int aSlotXFinish2 = aSlotXStart2 + (18*4);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getSlotCount() {
+ return mTotalSlotCount;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return mInputslotCount;
+ }
+
+ /*
+ * Uselss stuff copied from GT
+ */
+
+
+ public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0;
+ private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0, mTimer = 0;
+
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+ mStorage = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getEUCapacity());
+ mEnergy = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getStoredEU());
+ mSteamStorage = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getSteamCapacity());
+ mSteam = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getStoredSteam());
+ mOutput = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getOutputVoltage());
+ mInput = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getInputVoltage());
+ mDisplayErrorCode = mTileEntity.getErrorDisplayID();
+ mProgressTime = mTileEntity.getProgress();
+ mMaxProgressTime = mTileEntity.getMaxProgress();
+ mActive = mTileEntity.isActive() ? 1 : 0;
+ mTimer++;
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ if (mTimer % 500 == 10 || oEnergy != mEnergy) {
+ var1.sendProgressBarUpdate(this, 0, mEnergy & 65535);
+ var1.sendProgressBarUpdate(this, 1, mEnergy >>> 16);
+ }
+ if (mTimer % 500 == 10 || oStorage != mStorage) {
+ var1.sendProgressBarUpdate(this, 2, mStorage & 65535);
+ var1.sendProgressBarUpdate(this, 3, mStorage >>> 16);
+ }
+ if (mTimer % 500 == 10 || oOutput != mOutput) {
+ var1.sendProgressBarUpdate(this, 4, mOutput);
+ }
+ if (mTimer % 500 == 10 || oInput != mInput) {
+ var1.sendProgressBarUpdate(this, 5, mInput);
+ }
+ if (mTimer % 500 == 10 || oDisplayErrorCode != mDisplayErrorCode) {
+ var1.sendProgressBarUpdate(this, 6, mDisplayErrorCode);
+ }
+ if (mTimer % 500 == 10 || oProgressTime != mProgressTime) {
+ var1.sendProgressBarUpdate(this, 11, mProgressTime & 65535);
+ var1.sendProgressBarUpdate(this, 12, mProgressTime >>> 16);
+ }
+ if (mTimer % 500 == 10 || oMaxProgressTime != mMaxProgressTime) {
+ var1.sendProgressBarUpdate(this, 13, mMaxProgressTime & 65535);
+ var1.sendProgressBarUpdate(this, 14, mMaxProgressTime >>> 16);
+ }
+ if (mTimer % 500 == 10 || oID != mID) {
+ var1.sendProgressBarUpdate(this, 15, mID);
+ }
+ if (mTimer % 500 == 10 || oActive != mActive) {
+ var1.sendProgressBarUpdate(this, 16, mActive);
+ }
+ if (mTimer % 500 == 10 || oSteam != mSteam) {
+ var1.sendProgressBarUpdate(this, 17, mSteam & 65535);
+ var1.sendProgressBarUpdate(this, 18, mSteam >>> 16);
+ }
+ if (mTimer % 500 == 10 || oSteamStorage != mSteamStorage) {
+ var1.sendProgressBarUpdate(this, 19, mSteamStorage & 65535);
+ var1.sendProgressBarUpdate(this, 20, mSteamStorage >>> 16);
+ }
+ }
+
+ oID = mID;
+ oSteam = mSteam;
+ oInput = mInput;
+ oActive = mActive;
+ oOutput = mOutput;
+ oEnergy = mEnergy;
+ oStorage = mStorage;
+ oSteamStorage = mSteamStorage;
+ oProgressTime = mProgressTime;
+ oMaxProgressTime = mMaxProgressTime;
+ oDisplayErrorCode = mDisplayErrorCode;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 0:
+ mEnergy = mEnergy & -65536 | par2;
+ break;
+ case 1:
+ mEnergy = mEnergy & 65535 | par2 << 16;
+ break;
+ case 2:
+ mStorage = mStorage & -65536 | par2;
+ break;
+ case 3:
+ mStorage = mStorage & 65535 | par2 << 16;
+ break;
+ case 4:
+ mOutput = par2;
+ break;
+ case 5:
+ mInput = par2;
+ break;
+ case 6:
+ mDisplayErrorCode = par2;
+ break;
+ case 11:
+ mProgressTime = mProgressTime & -65536 | par2;
+ break;
+ case 12:
+ mProgressTime = mProgressTime & 65535 | par2 << 16;
+ break;
+ case 13:
+ mMaxProgressTime = mMaxProgressTime & -65536 | par2;
+ break;
+ case 14:
+ mMaxProgressTime = mMaxProgressTime & 65535 | par2 << 16;
+ break;
+ case 15:
+ mID = par2;
+ break;
+ case 16:
+ mActive = par2;
+ break;
+ case 17:
+ mSteam = mSteam & -65536 | par2;
+ break;
+ case 18:
+ mSteam = mSteam & 65535 | par2 << 16;
+ break;
+ case 19:
+ mSteamStorage = mSteamStorage & -65536 | par2;
+ break;
+ case 20:
+ mSteamStorage = mSteamStorage & 65535 | par2 << 16;
+ break;
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return mTileEntity.isUseableByPlayer(player);
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ }
+
+ private static class ViewingSlot extends SlotNoInput {
+
+ public ViewingSlot(IInventory inventory, int index, int x, int y) {
+ super(inventory, index, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ return false;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean canTakeStack(EntityPlayer p_82869_1_) {
+ return true;
+ }
+
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
new file mode 100644
index 0000000000..5623f0e224
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+
+public class GUI_1by1_Turbine extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_1by1_Turbine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_1by1_Turbine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "1by1.png");
+ mName = aName;
+ }
+
+ public GUI_1by1_Turbine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_1by1_Turbine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "1by1.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
new file mode 100644
index 0000000000..b427a632f7
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GUI_2by2 extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(containerType, RES_PATH_GUI + "2by2.png");
+ mName = aName;
+ }
+
+ public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(containerType, RES_PATH_GUI + aBackground + "2by2.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
new file mode 100644
index 0000000000..aced4342b3
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+public class GUI_4by4 extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(containerType, RES_PATH_GUI + "4by4.png");
+ mName = aName;
+ }
+
+ public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(containerType, RES_PATH_GUI + aBackground + "4by4.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java
new file mode 100644
index 0000000000..dd19571646
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java
@@ -0,0 +1,59 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.gui.GT_GUIContainer;
+
+public class GUI_HatchNbtConsumable extends GT_GUIContainer {
+
+ private final String mName;
+ private final int mTotalSlotCount;
+ public final CONTAINER_HatchNbtConsumable mContainer;
+
+ public GUI_HatchNbtConsumable(CONTAINER_HatchNbtConsumable aContainer, String aName) {
+ super(aContainer, RES_PATH_GUI + getTextureForGUI(aContainer.mInputslotCount*2)+".png");
+ mContainer = aContainer;
+ mName = aName;
+ mTotalSlotCount = aContainer.mInputslotCount*2;
+ }
+
+ private static final String getTextureForGUI(int aTotalSlotCOunt) {
+ if (aTotalSlotCOunt == 18) {
+ return "HatchNbtConsumable_3By3";
+ }
+ else if (aTotalSlotCOunt == 32) {
+ return "HatchNbtConsumable_4By4";
+ }
+ else {
+ return "HatchNbtConsumable_2By2";
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ if (mTotalSlotCount == 18) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ fontRendererObj.drawString("Stock", 25, 14, 4210752);
+ fontRendererObj.drawString("Active", 115, 14, 4210752);
+ }
+ else if (mTotalSlotCount == 32) {
+ //fontRendererObj.drawString("Slots: "+mTotalSlotCount, 8, 4, 4210752);
+ //fontRendererObj.drawString(mName, 8, 4, 4210752);
+ //fontRendererObj.drawString("Stock", 25, 16, 4210752);
+ //fontRendererObj.drawString("Active", 115, 16, 4210752);
+ }
+ else {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ fontRendererObj.drawString("Stock", 25, 16, 4210752);
+ fontRendererObj.drawString("Active", 115, 16, 4210752);
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
new file mode 100644
index 0000000000..00d022c481
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import gtPlusPlus.core.slots.SlotElectric;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_2by2;
+
+public class CONTAINER_Electric_2by2 extends CONTAINER_2by2{
+
+ public CONTAINER_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new SlotElectric(mTileEntity, 0, 71, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 1, 89, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 2, 71, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 3, 89, 44));
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
new file mode 100644
index 0000000000..1f833eb3cb
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import gtPlusPlus.core.slots.SlotElectric;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_4by4;
+
+public class CONTAINER_Electric_4by4 extends CONTAINER_4by4{
+
+ public CONTAINER_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new SlotElectric(mTileEntity, 0, 53, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 1, 71, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 2, 89, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 3, 107, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 4, 53, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 5, 71, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 6, 89, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 7, 107, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 8, 53, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 9, 71, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 10, 89, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 11, 107, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 12, 53, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 13, 71, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 14, 89, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 15, 107, 62));
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
new file mode 100644
index 0000000000..9be7104bbc
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_2by2;
+
+public class GUI_Electric_2by2 extends GUI_2by2{
+
+ public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
+ }
+
+ public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "2by2.png");
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
new file mode 100644
index 0000000000..ed3fce5e2c
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_4by4;
+
+public class GUI_Electric_4by4 extends GUI_4by4{
+
+ public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
+ }
+
+ public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "4by4.png");
+
+ }
+
+}