aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-02-04 00:54:48 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-02-04 00:54:48 +1000
commitc736d1091698a2ef1a4a4c953392683d12abdc93 (patch)
tree6ef4beedf5fc653995c98c3d1d645b113557797b /src/Java/gtPlusPlus/xmod/gregtech/api
parent4e3816e70a7cd9a36f609e421911275444ddbb75 (diff)
downloadGT5-Unofficial-c736d1091698a2ef1a4a4c953392683d12abdc93.tar.gz
GT5-Unofficial-c736d1091698a2ef1a4a4c953392683d12abdc93.tar.bz2
GT5-Unofficial-c736d1091698a2ef1a4a4c953392683d12abdc93.zip
+ Added Super Chests.
$ More work on Gregtech ASM. > NBTTagCompound is now created in MetaTileEntity. getDrops() & breakBlock() are also both overwritten.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java69
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java37
3 files changed, 110 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 898565352b..ff46212aa4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -278,7 +278,10 @@ public enum GregtechItemList implements GregtechItemContainer {
//Tesla Tower
TelsaTower,
- Battery_Gem_1, Battery_Gem_2, Battery_Gem_3,
+ Battery_Gem_1, Battery_Gem_2, Battery_Gem_3,
+
+ //Super Tier Chests
+ Super_Chest_LV, Super_Chest_MV, Super_Chest_HV, Super_Chest_EV, Super_Chest_IV,
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java
new file mode 100644
index 0000000000..0c33baeda4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java
@@ -0,0 +1,69 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+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.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
+
+import java.util.Iterator;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+
+public class CONTAINER_SuperChest extends GT_ContainerMetaTile_Machine {
+ public int mContent = 0;
+
+ public CONTAINER_SuperChest(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 (this.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_TieredChest) {
+ this.mContent = ((GT_MetaTileEntity_TieredChest) this.mTileEntity.getMetaTileEntity()).mItemCount;
+ } 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/GUI_SuperChest.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java
new file mode 100644
index 0000000000..259f589950
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+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_SuperChest extends GT_GUIContainerMetaTile_Machine {
+ private final String mName;
+
+ public GUI_SuperChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
+ String aName) {
+ super(new CONTAINER_SuperChest(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("Item Amount", 10, 20, 16448255);
+ this.fontRendererObj.drawString(
+ GT_Utility.parseNumberToString(((CONTAINER_SuperChest) 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