diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-18 15:27:09 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-10-18 15:27:09 +0100 |
commit | f53caf47183769b5c39f65c3715715889db11718 (patch) | |
tree | 3dacc355a71c362d7ee9f266b9dc868fa4662cd3 /src/Java/gtPlusPlus/xmod/gregtech/api/gui | |
parent | 734e7a1498ef6ca48f95f075aaa66372639c9618 (diff) | |
download | GT5-Unofficial-f53caf47183769b5c39f65c3715715889db11718.tar.gz GT5-Unofficial-f53caf47183769b5c39f65c3715715889db11718.tar.bz2 GT5-Unofficial-f53caf47183769b5c39f65c3715715889db11718.zip |
+ Added basework for XL Turbines.
$ Fixed issue where hatches/busses could be counted multiple times on multiblock structure checks. I now add them to a set as opposed to an arraylist.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java | 60 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java | 36 |
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); + } +} |