diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-13 00:28:02 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-13 00:28:02 +0000 |
commit | 3e519e890249825dc8face0087cc631684d36e8c (patch) | |
tree | 33f667dc118da284af154ffbfe9f926ff55928a8 /src/main/java/gtPlusPlus/xmod/gregtech/api/gui | |
parent | b72a9b138fafceab899c1bd86fee64decb9fb98a (diff) | |
download | GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.tar.gz GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.tar.bz2 GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.zip |
Basically finished work on Reactor Simulator.
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/gui')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java | 12 | ||||
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java index 0ebfd65aeb..477bcef092 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java @@ -8,6 +8,7 @@ import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.gui.GT_Slot_Output; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -151,11 +152,11 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { return null; } Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex); - ItemStack tStack = tSlot.getStack(); if (tSlot == null) { Logger.INFO("Null Slot?"); } else { + ItemStack tStack = tSlot.getStack(); Logger.INFO("Good Slot!"); if (aSlotIndex == 0) { Logger.INFO("Slot is 0"); @@ -224,21 +225,29 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { else { if (aShifthold == 1) { tSlot.putStack(null); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null); return null; } + + if (aMouseclick == 1) { + tSlot.putStack(null); + } if (aMouseclick == 0) { if (tStack == null) { if (getSlot(58).getStack() != null && aSlotIndex != 58) { tSlot.putStack(getSlot(58).getStack().copy()); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, new GT_ItemStack(getSlot(58).getStack().copy())); } else { tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1)); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0)); } return null; } for (int i = 1; i < GT_TileEntity_ComputerCube.sReactorList.size(); i++) { if (GT_TileEntity_ComputerCube.sReactorList.get(i - 1).mItem == tStack.getItem()) { tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(i).mItem, 1, 0)); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(i)); /*if (tSlot.getStack() != null && tSlot.getStack().getItem() == GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) { tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1); }*/ @@ -246,6 +255,7 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { } } tSlot.putStack(null); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null); return null; } if (tStack == null) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java index d226503b9c..47795f4510 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java @@ -46,7 +46,7 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin this.fontRendererObj.drawString("HEM: " + (tContainer.mHEM / 10000.0F), 7, 128, 16448255); this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + "/" + toNumber(tContainer.mMaxHeat) + "Heat", 7, 136, 16448255); this.fontRendererObj.drawString("Explosionpower: " + (tContainer.mExplosionStrength / 100.0F), 7, 144, 16448255); - this.fontRendererObj.drawString("Runtime: " + ((tContainer.mEUOut > 0) ? ((tContainer.mEU / tContainer.mEUOut) / 20.0F) : 0.0F) + "secs", 7, 152, 16448255); + this.fontRendererObj.drawString("Runtime: " + ((tContainer.mProgress > 0) ? (/*(tContainer.mEU / tContainer.mEUOut)*/ tContainer.mProgress / 20) : 0) + "secs", 7, 152, 16448255); break; case 2 : this.fontRendererObj.drawString("Scanner", 51, 7, 16448255); |