diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
tree | cb302d8e0f46e06be0b1d391317578b165aec245 /src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java | |
parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip |
Move source directory
Diffstat (limited to 'src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java')
-rw-r--r-- | src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java new file mode 100644 index 0000000000..01c0a95346 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java @@ -0,0 +1,69 @@ +package gregtech.common.gui; + +import java.util.Iterator; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +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 gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; + +public class GT_Container_QuantumChest extends GT_ContainerMetaTile_Machine { + + public GT_Container_QuantumChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 80, 17)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 1, 80, 53)); + addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 59, 42)); + } + + public int mContent = 0; + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + if (mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest){ + mContent = ((GT_MetaTileEntity_QuantumChest)mTileEntity.getMetaTileEntity()).mItemCount; + }else{ + mContent = 0;} + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting)var2.next(); + var1.sendProgressBarUpdate(this, 100, mContent & 65535); + var1.sendProgressBarUpdate(this, 101, mContent >>> 16); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: mContent = mContent & -65536 | par2; break; + case 101: mContent = mContent & 65535 | par2 << 16; break; + } + } + + @Override + public int getSlotCount() { + return 2; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} |