diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-04-18 01:49:55 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-04-18 01:49:55 +1000 |
commit | bd586aea681d1ecf7842c00f44cf03c7ef33b9d9 (patch) | |
tree | 346a36da03bbb608430bc3f1b857462032ae646f /src/Java/gtPlusPlus/xmod/gregtech/api/gui/power | |
parent | b9d166c56f38dee13b5a03cab93f504b46fed7d2 (diff) | |
download | GT5-Unofficial-bd586aea681d1ecf7842c00f44cf03c7ef33b9d9.tar.gz GT5-Unofficial-bd586aea681d1ecf7842c00f44cf03c7ef33b9d9.tar.bz2 GT5-Unofficial-bd586aea681d1ecf7842c00f44cf03c7ef33b9d9.zip |
$ Fixed Semifluid Generators. Closes #450
$ Adjusted Simple Washer IDs.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui/power')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java | 69 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java | 36 |
2 files changed, 105 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java new file mode 100644 index 0000000000..9a58e74ec4 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java @@ -0,0 +1,69 @@ +package gtPlusPlus.xmod.gregtech.api.gui.power; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.gui.GT_Slot_Render; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.GTPP_MTE_BasicTank; + +import java.util.Iterator; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +public class CONTAINER_BasicTank extends GT_ContainerMetaTile_Machine { + public int mContent = 0; + + public CONTAINER_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17)); + this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53)); + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 59, 42)); + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { + if (((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) { + this.mContent = ((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount; + } else { + this.mContent = 0; + } + + Iterator var2 = this.crafters.iterator(); + + while (var2.hasNext()) { + ICrafting var1 = (ICrafting) var2.next(); + var1.sendProgressBarUpdate(this, 100, this.mContent & ''); + var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16); + } + + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100 : + this.mContent = this.mContent & -65536 | par2; + break; + case 101 : + this.mContent = this.mContent & '' | par2 << 16; + } + + } + + public int getSlotCount() { + return 2; + } + + public int getShiftClickSlotCount() { + return 1; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java new file mode 100644 index 0000000000..a03aac346b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java @@ -0,0 +1,36 @@ +package gtPlusPlus.xmod.gregtech.api.gui.power; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; + +public class GUI_BasicTank extends GT_GUIContainerMetaTile_Machine { + private final String mName; + + public GUI_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new CONTAINER_BasicTank(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BasicTank.png"); + this.mName = aName; + } + + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, + 4210752); + this.fontRendererObj.drawString(this.mName, 8, 6, 4210752); + if (this.mContainer != null) { + this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + this.fontRendererObj.drawString( + GT_Utility.parseNumberToString(((CONTAINER_BasicTank) this.mContainer).mContent), 10, 30, + 16448255); + } + + } + + 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; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } +}
\ No newline at end of file |