aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-05 23:39:36 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-05 23:39:36 +1000
commit07f18d6a4ac289535de87809a30c34f71d984394 (patch)
treef6a1e07f3fd4f2b0264c1a13b4fd8c46dc072ed1 /src/Java
parentbb4b59c07a43deaa36ca4eab0a2aeaf979f0dad6 (diff)
downloadGT5-Unofficial-07f18d6a4ac289535de87809a30c34f71d984394.tar.gz
GT5-Unofficial-07f18d6a4ac289535de87809a30c34f71d984394.tar.bz2
GT5-Unofficial-07f18d6a4ac289535de87809a30c34f71d984394.zip
+ Added New Centrifuge GUI Texture.
% Rewrote Centrifuge GUI/Container workings.
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java9
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java71
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java12
3 files changed, 44 insertions, 48 deletions
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
index b41d7db67d..87d4b5bd4d 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
@@ -2,6 +2,7 @@ package miscutil.core.xmod.gregtech.api.gui;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
@@ -11,7 +12,15 @@ import net.minecraft.inventory.Slot;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_IndustrialCentrifuge extends GT_ContainerMetaTile_Machine {
+
+ public double recipesCompleted = getRecipesCompleted();
+
+ private double getRecipesCompleted(){
+ return ((GregtechMetaTileEntityIndustrialCentrifuge)this.mTileEntity.getMetaTileEntity()).recipesComplete;
+ }
+
public CONTAINER_IndustrialCentrifuge(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+
super(aInventoryPlayer, aTileEntity);
}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
index ecbf4d9290..7a9a0ffd5e 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
@@ -7,7 +7,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import java.util.List;
import miscutil.core.lib.CORE;
-import miscutil.core.util.Utils;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -29,57 +28,37 @@ public class GUI_IndustrialCentrifuge extends GT_GUIContainerMetaTile_Machine {
super(new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
mName = aName;
}
-
+
private boolean getValidInventoryItem(){
if (itemSlots != null){
- ItemStack invCheck = (ItemStack) itemSlots.get(0);
- if (invCheck == null){
- return false;
- }
- else if (invCheck != null){
- return true;
- }
+ ItemStack invCheck = (ItemStack) itemSlots.get(0);
+ if (invCheck == null){
+ return false;
+ }
+ else if (invCheck != null){
+ tempStack = invCheck;
+ return true;
+ }
}
return false;
}
+
+ private double getValueRecipes(){
+ return ((CONTAINER_IndustrialCentrifuge) mContainer).recipesCompleted;
+ }
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRendererObj.drawString(mName, 10, 8, 16448255);
- counter++;
+ if (counter >= 100){
+ counter = 0;
+ }
+ else {
+ counter++;
+ }
if (mContainer != null) {
- try {
-
- if (tempStack == null || counter > 500){
- itemSlots = null;
- if (itemSlots == null){
- itemSlots = ((CONTAINER_IndustrialCentrifuge) mContainer).inventorySlots;
- }
- if (itemSlots != null){
- if (getValidInventoryItem()){
- tempStack = (ItemStack) itemSlots.get(0);
- fontRendererObj.drawString("Item in item slot.", 10, 48, 16448255);
- }
- else {
- fontRendererObj.drawString("No Item in item slot.", 10, 48, 16448255);
- tempStack = null;
- itemSlots = null;
- counter = 0;
- }
- }
-
-
- }
- if (tempStack != null){
- fontRendererObj.drawString("Item in item slot.", 10, 48, 16448255);
- }
-
- }
- catch (Throwable e){
- Utils.LOG_INFO("NULL");
- }
-
- fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
+
+ //double temp = ((CONTAINER_IndustrialCentrifuge) mContainer).recipesCompleted;
if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 1) != 0)
fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 2) != 0)
@@ -100,9 +79,15 @@ public class GUI_IndustrialCentrifuge extends GT_GUIContainerMetaTile_Machine {
fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
} else {
fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ if (CORE.DEBUG){
+ fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
+ }
+ else {
+ //fontRendererObj.drawString("Recipes Completed: "+getValueRecipes(), 10, 56, 16448255);
+ }
}
}
- }
+ }
}
@Override
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
index aaccff4693..ddec100663 100644
--- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
@@ -30,6 +30,7 @@ import org.apache.commons.lang3.ArrayUtils;
public class GregtechMetaTileEntityIndustrialCentrifuge
extends GregtechMeta_MultiBlockBase {
private static boolean controller;
+ public static double recipesComplete = 0;
public GregtechMetaTileEntityIndustrialCentrifuge(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -49,14 +50,14 @@ extends GregtechMeta_MultiBlockBase {
return new String[]{
"Controller Block for the Industrial Centrifuge",
"Size: 3x3x3 (Hollow)",
- "Controller (Front Center)",
- "1x Maintenance Hatch (Rear Center)",
- "The rest can be placed anywhere except the Front",
+ "Controller (Front Center) [Orange]",
+ "1x Maintenance Hatch (Rear Center) [Green]",
+ "The rest can be placed anywhere except the Front [Red]",
"1x Input Hatch",
"1x Output Hatch",
"1x Input Bus",
"1x Output Bus",
- "1x [EV] Energy Hatch (Can be higher Tier)",
+ "1x [EV] Energy Hatch (Can be higher Tier) [Blue]",
"Needs a Turbine Item (inside controller GUI)",
"Centrifuge Casings for the rest (16 at least)",};
}
@@ -76,7 +77,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_IndustrialCentrifuge(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "CokeOven.png");
+ return new GUI_IndustrialCentrifuge(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialCentrifuge.png");
}
@Override
@@ -208,6 +209,7 @@ extends GregtechMeta_MultiBlockBase {
this.mOutputItems = tOut;
this.mOutputFluids = new FluidStack[]{tFOut};
updateSlots();
+ recipesComplete++;
return true;
}
}