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/hatches/CONTAINER_1by1_Turbine.java60
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java36
2 files changed, 96 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
new file mode 100644
index 0000000000..d4d2fcacd7
--- /dev/null
+++ b/src/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/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
new file mode 100644
index 0000000000..5623f0e224
--- /dev/null
+++ b/src/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);
+ }
+}