aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 15:03:44 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 15:03:44 +1000
commit6b0f5931f685459ad83f26e0d19b648b9fa08b50 (patch)
tree1e3c701a8319f373911dc3410bd9a7e09effaf29
parentf887c642796d77adb7a5baf559092807d8274f81 (diff)
downloadGT5-Unofficial-6b0f5931f685459ad83f26e0d19b648b9fa08b50.tar.gz
GT5-Unofficial-6b0f5931f685459ad83f26e0d19b648b9fa08b50.tar.bz2
GT5-Unofficial-6b0f5931f685459ad83f26e0d19b648b9fa08b50.zip
$ Fixed GUI issue with new super buffers.
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_ThreadedSuperBuffer.java82
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_ThreadedSuperBuffer.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java9
3 files changed, 105 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_ThreadedSuperBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_ThreadedSuperBuffer.java
new file mode 100644
index 0000000000..2151e5a109
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_ThreadedSuperBuffer.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.util.GT_Utility;
+import gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer;
+
+import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ThreadedChestBuffer;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.inventory.IInventory;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+
+public class CONTAINER_ThreadedSuperBuffer extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_ThreadedSuperBuffer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer((Slot) new GT_Slot_Holo((IInventory) this.mTileEntity, 256, 8, 63, false, true, 1));
+ this.addSlotToContainer((Slot) new GT_Slot_Holo((IInventory) this.mTileEntity, 256, 26, 63, false, true, 1));
+ this.addSlotToContainer((Slot) new GT_Slot_Holo((IInventory) this.mTileEntity, 256, 44, 63, false, true, 1));
+ }
+
+ public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
+ final EntityPlayer aPlayer) {
+ if (aSlotIndex < 0) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ final Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (this.mTileEntity.getMetaTileEntity() == null) {
+ return null;
+ }
+ if (aSlotIndex == 0) {
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bOutput = !((GT_MetaTileEntity_ThreadedChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bOutput;
+ if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("116", "Emit Energy to Outputside"));
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("117", "Don't emit Energy"));
+ }
+ return null;
+ }
+ if (aSlotIndex == 1) {
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bRedstoneIfFull = !((GT_MetaTileEntity_ThreadedChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bRedstoneIfFull;
+ if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("118", "Emit Redstone if no Slot is free"));
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("119", "Don't emit Redstone"));
+ }
+ return null;
+ }
+ if (aSlotIndex == 2) {
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bInvert = !((GT_MetaTileEntity_ThreadedChestBuffer) this.mTileEntity
+ .getMetaTileEntity()).bInvert;
+ if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("120", "Invert Redstone"));
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, this.trans("121", "Don't invert Redstone"));
+ }
+ return null;
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ public int getSlotCount() {
+ return 0;
+ }
+
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_ThreadedSuperBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_ThreadedSuperBuffer.java
new file mode 100644
index 0000000000..83e96cd85b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_ThreadedSuperBuffer.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+
+public class GUI_ThreadedSuperBuffer extends GT_GUIContainerMetaTile_Machine {
+ public GUI_ThreadedSuperBuffer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super((GT_ContainerMetaTile_Machine) new CONTAINER_ThreadedSuperBuffer(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/SuperBuffer.png");
+ }
+
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java
index 9643ca3394..862637a6e3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ThreadedSuperBuffer.java
@@ -1,11 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
-import gregtech.common.gui.GT_GUIContainer_SuperBuffer;
-
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_ThreadedSuperBuffer;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_ThreadedSuperBuffer;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import gregtech.common.gui.GT_Container_SuperBuffer;
import net.minecraft.entity.player.InventoryPlayer;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.objects.GT_RenderedTexture;
@@ -46,11 +45,11 @@ public class GT_MetaTileEntity_ThreadedSuperBuffer extends GT_MetaTileEntity_Thr
public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ return new CONTAINER_ThreadedSuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
}
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ return new GUI_ThreadedSuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
}
} \ No newline at end of file