aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-14 20:22:34 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-14 20:22:34 +0000
commitf6599e799922840f2e5c94d2c0b638357e75e5cd (patch)
tree7627ab7fd0267cc26a8e36e74bf92f9493f933e8 /src/main
parent87b3fdb080ad0409d9593e09f4206e5d70c78756 (diff)
downloadGT5-Unofficial-f6599e799922840f2e5c94d2c0b638357e75e5cd.tar.gz
GT5-Unofficial-f6599e799922840f2e5c94d2c0b638357e75e5cd.tar.bz2
GT5-Unofficial-f6599e799922840f2e5c94d2c0b638357e75e5cd.zip
Fix Computer Cube GUI.
Fix Glod's shitty implementation of perfect OC which broke some multis.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/core/util/math/MathUtils.java131
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java76
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java40
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java (renamed from src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputercubeDescription.java)93
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java35
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java284
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java2
12 files changed, 320 insertions, 396 deletions
diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
index 7573e0d51c..5c7a5bac6d 100644
--- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
@@ -16,12 +16,12 @@ public class MathUtils {
final static Random rand = CORE.RANDOM;
- /** Formats a number with group separator and at most 2 fraction digits. */
- private static final NumberFormat sNumberFormat = NumberFormat.getInstance();
-
- static {
- sNumberFormat.setMaximumFractionDigits(2);
- }
+ /** Formats a number with group separator and at most 2 fraction digits. */
+ private static final NumberFormat sNumberFormat = NumberFormat.getInstance();
+
+ static {
+ sNumberFormat.setMaximumFractionDigits(2);
+ }
/**
* Returns a psuedo-random number between min and max, inclusive.
@@ -554,7 +554,7 @@ public class MathUtils {
return 0;
}
}
-
+
public static <V> V safeCast(Object aNumberType) {
long a1;
double a2;
@@ -573,7 +573,7 @@ public class MathUtils {
String s = ""+a1;
Short s1 = Short.valueOf(s);
return (V) s1;
-
+
}
}
else if ((aNumberType.getClass() == int.class) || (aNumberType instanceof Integer)){
@@ -581,7 +581,7 @@ public class MathUtils {
String s = ""+a1;
Integer s1 = Integer.valueOf(s);
return (V) s1;
-
+
}
}
else if ((aNumberType.getClass() == long.class) || (aNumberType instanceof Long)){
@@ -596,7 +596,7 @@ public class MathUtils {
String s = ""+a1;
Float s1 = Float.valueOf(s);
return (V) s1;
-
+
}
}
else if ((aNumberType.getClass() == double.class) || (aNumberType instanceof Double)){
@@ -604,40 +604,40 @@ public class MathUtils {
String s = ""+a1;
Double s1 = Double.valueOf(s);
return (V) s1;
-
+
}
}
-
+
Integer o = 0;
return (V) o;
-
+
}
-
+
public static byte getSafeByte(Byte b) {
Byte a = safeCast(b);
return a.byteValue();
}
-
+
public static short getSafeShort(Short b) {
Short a = safeCast(b);
return a.shortValue();
}
-
+
public static int getSafeInt(Integer b) {
Integer a = safeCast(b);
return a.intValue();
}
-
+
public static long getSafeLong(Long b) {
Long a = safeCast(b);
return a.longValue();
}
-
+
public static float getSafeFloat(Float b) {
Float a = safeCast(b);
return a.floatValue();
}
-
+
public static double getSafeDouble(Double b) {
Double a = safeCast(b);
return a.doubleValue();
@@ -699,7 +699,7 @@ public class MathUtils {
public static int balance(int aInput, int aMin, int aMax) {
return Math.max(Math.min(aInput, aMax), aMin);
}
-
+
/**
* Balances a number within a range.
* @param aInput - The number to balance
@@ -710,7 +710,7 @@ public class MathUtils {
public static Number balance(Number aInput, Number aMin, Number aMax) {
return max(min(aInput, aMax), aMin);
}
-
+
/**
* Balances a number within a range.
* @param aInput - The number to balance
@@ -721,7 +721,7 @@ public class MathUtils {
public static int balanceInt(Number aInput, Number aMin, Number aMax) {
return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE));
}
-
+
/**
* Balances a number within a range.
* @param aInput - The number to balance
@@ -737,51 +737,62 @@ public class MathUtils {
int aAmount = Math.max(Math.min(i, aMax), aMin);
return aAmount;
}
-
+
public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong){
int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong/Integer.MAX_VALUE));
int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE));
return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder);
}
-
-
- /**
- * Returns the smaller of two {@code Number}s. That is,
- * the result the argument closer to the value of
- * {@link Long#MIN_VALUE}. If the arguments have the same
- * value, the result is that same value.
- *
- * @param a an argument.
- * @param b another argument.
- * @return the smaller of {@code a} and {@code b}.
- */
- public static Number min(Number a, Number b) {
- return (a.longValue() <= b.longValue()) ? a : b;
- }
-
- /**
- * Returns the greater of two {@code Number}s. That is, the
- * result is the argument closer to the value of
- * {@link Long#MAX_VALUE}. If the arguments have the same value,
- * the result is that same value.
- *
- * @param a an argument.
- * @param b another argument.
- * @return the larger of {@code a} and {@code b}.
- */
- public static Number max(Number a, Number b) {
- return (a.longValue() >= b.longValue()) ? a : b;
- }
-
- public static String formatNumbers(long aNumber) {
- return sNumberFormat.format(aNumber);
- }
-
- public static String formatNumbers(double aNumber) {
- return sNumberFormat.format(aNumber);
- }
+
+
+ /**
+ * Returns the smaller of two {@code Number}s. That is,
+ * the result the argument closer to the value of
+ * {@link Long#MIN_VALUE}. If the arguments have the same
+ * value, the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the smaller of {@code a} and {@code b}.
+ */
+ public static Number min(Number a, Number b) {
+ return (a.longValue() <= b.longValue()) ? a : b;
+ }
+
+ /**
+ * Returns the greater of two {@code Number}s. That is, the
+ * result is the argument closer to the value of
+ * {@link Long#MAX_VALUE}. If the arguments have the same value,
+ * the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the larger of {@code a} and {@code b}.
+ */
+ public static Number max(Number a, Number b) {
+ return (a.longValue() >= b.longValue()) ? a : b;
+ }
+
+ public static long combineTwoIntegersToLong(int a, int b) {
+ long val = (((long) a) << 32) | (b & 0xffffffffL);
+ return val;
+ }
+ public static int[] splitLongIntoTwoIntegers(long aNum) {
+ int a = (int) (aNum >> 32);
+ int b = (int) aNum;
+ return new int[] {a, b};
+ }
+
+ public static String formatNumbers(long aNumber) {
+ return sNumberFormat.format(aNumber);
+ }
+
+ public static String formatNumbers(double aNumber) {
+ return sNumberFormat.format(aNumber);
+ }
+
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 3e294a076c..913b72fb0a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -55,7 +55,7 @@ import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputerCube_Setup;
-import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputercubeDescription;
+import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_ElementalDuplicator;
import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks;
@@ -178,7 +178,7 @@ public class HANDLER_GT {
convertPyroToCokeOven();
generateElementalDuplicatorRecipes();
Meta_GT_Proxy.fixIC2FluidNames();
- GT_ComputercubeDescription.addStandardDescriptions();
+ GT_Computercube_Description.addStandardDescriptions();
GT_ComputerCube_Setup.init();
RecipeLoader_AlgaeFarm.generateRecipes();
if (LoadedMods.AdvancedSolarPanel) {
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 477bcef092..80202695e7 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
@@ -9,11 +9,12 @@ 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;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@@ -23,7 +24,9 @@ import net.minecraft.item.ItemStack;
public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
- public int mEUOut;
+ public long mEUOut;
+ public int mEUOut1;
+ public int mEUOut2;
public int mHeat;
@@ -33,7 +36,9 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
public int mExplosionStrength;
- public int mEU;
+ public long mEU;
+ public int mEU1;
+ public int mEU2;
public int mProgress;
@@ -41,6 +46,10 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
public GT_Container_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aID) {
super(aInventoryPlayer, aTileEntity);
+ Logger.INFO("1 Container Mode: "+aID);
+ Logger.INFO("2 Container Mode: "+getMode());
+ mID = getMode();
+ Logger.INFO("3 Container Mode: "+getMode());
// addSlotsComputer(aInventoryPlayer);
detectAndSendChanges();
}
@@ -56,7 +65,7 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
public void addSlotsComputer(InventoryPlayer aInventoryPlayer) {
int y;
mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
- Logger.INFO("Mode: " + mID);
+ Logger.INFO(""+(Utils.isClient() ? "Client" : "Server")+" Mode: " + mID);
addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1));
switch (this.mID) {
case 1 :
@@ -142,24 +151,24 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
}
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- Logger.INFO("Clicked slot " + aSlotIndex);
+ //Logger.INFO("Clicked slot " + aSlotIndex);
if (aSlotIndex < 0) {
- Logger.INFO("");
+ //Logger.INFO("");
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
if (this.mID != ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode) {
- Logger.INFO("This ID: " + mID + ", Tile: " + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
+ //Logger.INFO("This ID: " + mID + ", Tile: " + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
return null;
}
Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if (tSlot == null) {
- Logger.INFO("Null Slot?");
+ //Logger.INFO("Null Slot?");
}
else {
ItemStack tStack = tSlot.getStack();
- Logger.INFO("Good Slot!");
+ //Logger.INFO("Good Slot!");
if (aSlotIndex == 0) {
- Logger.INFO("Slot is 0");
+ //Logger.INFO("Slot is 0");
if (aMouseclick == 0) {
Logger.INFO("Forward");
((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeForward();
@@ -168,7 +177,12 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
Logger.INFO("Backwards");
((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeBackward();
}
- aPlayer.openGui(CORE.MODID, getComputerCubeGUIID(), this.mTileEntity.getWorld(), this.mTileEntity.getXCoord(), this.mTileEntity.getYCoord(), this.mTileEntity.getZCoord());
+ if (aPlayer instanceof EntityPlayerMP) {
+ EntityPlayerMP aPlayerMP = (EntityPlayerMP) aPlayer;
+ changePage(aPlayerMP, ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
+ }
+ //FMLNetworkHandler.openGui(entityPlayer, mod, modGuiId, world, x, y, z);
+ //aPlayer.openGui(CORE.MODID, getComputerCubeGUIID(), this.mTileEntity.getWorld(), this.mTileEntity.getXCoord(), this.mTileEntity.getYCoord(), this.mTileEntity.getZCoord());
}
else if (aSlotIndex <= 2 && this.mID == 3) {
if (aSlotIndex == 1) {
@@ -269,14 +283,21 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
}
}
else {
- Logger.INFO("Super 2");
+ //Logger.INFO("Super 2");
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
}
- Logger.INFO("???");
+ //Logger.INFO("???");
return null;
}
+
+
+ public void changePage(EntityPlayerMP aPlayerMP, int aMode) {
+ GT_TileEntity_ComputerCube aCompTile = (GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity();
+ aCompTile.onRightclick(mTileEntity, aPlayerMP);
+ }
+
public boolean doesBindPlayerInventory() {
return (this.mID != 1 && this.mID != 5);
}
@@ -288,26 +309,33 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
}
this.mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
this.mEUOut = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEUOut;
+ int[] aEUSplit1 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
+ this.mEUOut1 = aEUSplit1[0];
+ this.mEUOut2 = aEUSplit1[1];
this.mHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHeat;
this.mMaxHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxHeat;
this.mHEM = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHEM * 10000.0F);
this.mExplosionStrength = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mExplosionStrength * 100.0F);
this.mEU = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEU;
this.mProgress = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mProgress;
+ int[] aEUSplit2 = MathUtils.splitLongIntoTwoIntegers(mEU);
+ this.mEU1 = aEUSplit2[0];
+ this.mEU2 = aEUSplit2[1];
Iterator<ICrafting> var2 = this.crafters.iterator();
while (var2.hasNext()) {
ICrafting var1 = var2.next();
- var1.sendProgressBarUpdate((Container) this, 101, this.mEUOut);
+ var1.sendProgressBarUpdate((Container) this, 101, this.mID);
var1.sendProgressBarUpdate((Container) this, 102, this.mHeat & 0xFFFF);
var1.sendProgressBarUpdate((Container) this, 103, this.mMaxHeat & 0xFFFF);
var1.sendProgressBarUpdate((Container) this, 104, this.mHEM);
var1.sendProgressBarUpdate((Container) this, 105, this.mExplosionStrength);
var1.sendProgressBarUpdate((Container) this, 106, this.mHeat >>> 16);
var1.sendProgressBarUpdate((Container) this, 107, this.mMaxHeat >>> 16);
- var1.sendProgressBarUpdate((Container) this, 108, this.mEU & 0xFFFF);
- var1.sendProgressBarUpdate((Container) this, 109, this.mEU >>> 16);
+ var1.sendProgressBarUpdate((Container) this, 108, this.mEU1);
+ var1.sendProgressBarUpdate((Container) this, 109, this.mEU2);
var1.sendProgressBarUpdate((Container) this, 110, this.mProgress);
- var1.sendProgressBarUpdate((Container) this, 111, this.mID);
+ var1.sendProgressBarUpdate((Container) this, 111, this.mEUOut1);
+ var1.sendProgressBarUpdate((Container) this, 112, this.mEUOut2);
}
}
@@ -316,7 +344,7 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
super.updateProgressBar(par1, par2);
switch (par1) {
case 101 :
- this.mEUOut = par2;
+ this.mID = par2;
break;
case 102 :
this.mHeat = this.mHeat & 0xFFFF0000 | par2;
@@ -337,15 +365,19 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
this.mMaxHeat = this.mMaxHeat & 0xFFFF | par2 << 16;
break;
case 108 :
- this.mEU = this.mEU & 0xFFFF0000 | par2;
+ this.mEU1 = par2;
case 109 :
- this.mEU = this.mEU & 0xFFFF | par2 << 16;
+ this.mEU2 = par2;
+ this.mEU = MathUtils.combineTwoIntegersToLong(mEU1, mEU2);
break;
case 110 :
this.mProgress = par2;
break;
case 111 :
- this.mID = par2;
+ this.mEUOut1 = par2;
+ case 112 :
+ this.mEUOut2 = par2;
+ this.mEUOut = MathUtils.combineTwoIntegersToLong(mEUOut1, mEUOut2);
break;
}
}
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 47795f4510..c56e167319 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
@@ -3,8 +3,9 @@ package gtPlusPlus.xmod.gregtech.api.gui.computer;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputercubeDescription;
+import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -12,8 +13,12 @@ import net.minecraft.util.StatCollector;
public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machine {
public GT_GUIContainer_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aBaseMetaTileEntity, int aID) {
super(new GT_Container_ComputerCube(aInventoryPlayer, aBaseMetaTileEntity, aID), CORE.RES_PATH_GUI + "computer/"+aID+".png");
- if (aID == 5)
+ GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
+ Logger.INFO("1 GUI Mode: "+aID);
+ Logger.INFO("2 GUI Mode: "+tContainer.mID);
+ if (tContainer.mID == 5) {
this.xSize += 50;
+ }
}
@@ -33,6 +38,7 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
+ //Logger.INFO("3 GUI Mode: "+xSize);
//GT_TileEntity_ComputerCube tTileEntity = (GT_TileEntity_ComputerCube) tContainer.mTileEntity;
if (tContainer != null)
switch (tContainer.mID) {
@@ -78,13 +84,16 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin
this.fontRendererObj.drawString("OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 55, 16448255);
break;
case 5 :
- if (tContainer.mMaxHeat >= 0 && tContainer.mMaxHeat < GT_ComputercubeDescription.sDescriptions.size())
- for (int i = 0; i < ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(tContainer.mMaxHeat)).mDescription.length; i++) {
+ if (tContainer.mID == 5 && this.xSize == 176) {
+ this.xSize += 50;
+ }
+ if (tContainer.mMaxHeat >= 0 && tContainer.mMaxHeat < GT_Computercube_Description.sDescriptions.size())
+ for (int i = 0; i < ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription.length; i++) {
if (i == 0) {
- this.fontRendererObj.drawString(((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7, 16448255);
+ this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7, 16448255);
}
else {
- this.fontRendererObj.drawString(((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7
+ this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7
+ 8 * i, 16448255);
}
}
@@ -113,16 +122,16 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin
}
}
- public String toNumber(int aNumber) {
+ public String toNumber(long mEU) {
String tString = "";
boolean temp = true, negative = false;
- if (aNumber < 0) {
- aNumber *= -1;
+ if (mEU < 0) {
+ mEU *= -1;
negative = true;
}
int i;
for (i = 1000000000; i > 0; i /= 10) {
- int tDigit = aNumber / i % 10;
+ long tDigit = mEU / i % 10;
if (temp && tDigit != 0)
temp = false;
if (!temp) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index ec7115cb0f..1232166baa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -753,26 +753,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
}
- public boolean checkRecipeGeneric(GT_Recipe aRecipe,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, boolean isPerfectOC) {
- if (aRecipe == null) {
- return false;
- }
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe, isPerfectOC);
- }
-
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
- return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null, false);
- }
-
public boolean checkRecipeGeneric(GT_Recipe aRecipe,
int aMaxParallelRecipes, int aEUPercent,
int aSpeedBonusPercent, int aOutputChanceRoll) {
@@ -783,14 +763,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
ArrayList<FluidStack> tFluids = getStoredFluids();
ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe, false);
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe);
}
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, boolean isPerfectOC) {
- return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null, isPerfectOC);
+ int aSpeedBonusPercent, int aOutputChanceRoll) {
+ return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null);
}
@@ -941,10 +921,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
return rEnergy;
}
+ public boolean hasPerfectOverclock() {
+ return false;
+ }
+
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) {
+ int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
// Based on the Processing Array. A bit overkill, but very flexible.
// Reset outputs and progress stats
@@ -1069,8 +1053,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
} else {
while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
this.mEUt *= 4;
- if (isPerpectOC) this.mMaxProgresstime /= 4;
- else this.mMaxProgresstime /= 2;
+ if (hasPerfectOverclock()) {
+ this.mMaxProgresstime /= 4;
+ }
+ else {
+ this.mMaxProgresstime /= 2;
+ }
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputercubeDescription.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java
index ba48df1311..fedb4e6028 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputercubeDescription.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java
@@ -10,14 +10,14 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.item.ItemStack;
-public class GT_ComputercubeDescription {
- public static ArrayList<GT_ComputercubeDescription> sDescriptions = new ArrayList<GT_ComputercubeDescription>();
+public class GT_Computercube_Description {
+ public static ArrayList<GT_Computercube_Description> sDescriptions = new ArrayList<GT_Computercube_Description>();
public String[] mDescription;
public ItemStack[] mStacks;
- public GT_ComputercubeDescription(String[] aDescription, ItemStack[] aStacks) {
+ public GT_Computercube_Description(String[] aDescription, ItemStack[] aStacks) {
this.mDescription = aDescription;
this.mStacks = aStacks;
sDescriptions.add(this);
@@ -25,162 +25,167 @@ public class GT_ComputercubeDescription {
public static void addStandardDescriptions() {
Logger.INFO("Adding Default Description Set of the Computer Cube");
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Lightning Rod", "Also known as the Bane of", "Alblaka. The Lightning Rod", "enables you to gain Energy", "from Lightning! To set it up", "you just need the Block", "itself, 4 HV-Transformers", "and a crapton of Ironfences,", "which you then place on top", "of it. After that you have to",
"wait for a Thunderstorm and", "when you are lucky you get", "2.5 MFSU of Energy out of", "it. If a Rod is high enough", "then Rain is also enough to", "get stroke, but with less", "probability ofcourse." }, new ItemStack[] {
GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), ItemList.Machine_IV_LightningRod.get(1), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Quantum Chest", "You want to store tons of", "Materials into your Chests", "but you hate the Item limit", "of them? Not anymore! The", "Quantum Chest is able to", "store an INFINITE* amount", "of one single Item type per", "Chest.", "This Chest stores your Items",
- "like Data and ever has a", "Stack of the Item ready for", "extraction. It is compatible", "with any Item that doesnt", "have a NBT-Tag. You ask what", "NBT is? I know it, thats enough.", "* = 2147483391" }, new ItemStack[] {
- null, null, null, null, ItemList.Quantum_Chest_LV.get(1), null, null, null, null, null,
- null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ "like Data and ever has a", "Stack of the Item ready for", "extraction. It is compatible", "with any Item that doesnt", "have a NBT-Tag. You ask what", "NBT is? I know it, thats enough.", "Up to 2147483391*" }, new ItemStack[] {
+ ItemList.Quantum_Chest_IV.get(1), ItemList.Quantum_Chest_EV.get(1), ItemList.Quantum_Chest_HV.get(1), ItemList.Quantum_Chest_MV.get(1), ItemList.Quantum_Chest_LV.get(1), null,
+ null, null, null, null, null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Quantum Tank", "You want to store tons of", "Fluids into your Tanks", "but you hate the capacity", "of them? Not anymore! The", "Quantum Tank is able to", "store an INFINITE* amount", "of one single Fluid type per", "Tank.", "This Tank stores your Fluids",
+ "like Data and ever has a", "Stack of the Fluid ready for", "extraction. It is compatible", "with any Fluid. ", "You ask what", "NBT is? I know it, thats enough.", "* = 2147483391" }, new ItemStack[] {
+ ItemList.Quantum_Tank_IV.get(1), ItemList.Quantum_Tank_EV.get(1), ItemList.Quantum_Tank_HV.get(1), ItemList.Quantum_Tank_MV.get(1), ItemList.Quantum_Tank_LV.get(1), null,
+ null, null, null, null, null, null, null, null });
+ new GT_Computercube_Description(new String[] {
"Computer Cube", "The Device you are", "currently using. This Computer", "is running the G.L.A.D.-OS,", "which is containing many", "usefull Apps:", "- Reactor Planner", "- Seedbag Scanner", "- Recipelists for GT-Devices", "- ",
"- ", "- ", "- ", "- ", "And the Description List you", "are currently reading.", "~This Device has private Access~" }, new ItemStack[] {
- null, null, null, null, GregtechItemList.Gregtech_Computer_Cube.get(1), null, null, null, null, null,
+ null, null, null, null, GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), null, null, null, null, null,
null, null, null, null });
- /* new GT_ComputercubeDescription(new String[] {
+ /* new GT_Computercube_Description(new String[] {
"UUM-Assembler", "It's like an automatic", "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", "allows it to store all your", "UUM inside it.",
"Top and Bottom are for Input,", "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] {
null, null, null, GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Sonictron", "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.",
"Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", "Emits Redstone when finished." }, new ItemStack[] {
null, null, null, GregTech_API.getGregTechItem(32, 1, 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"L.E.S.U.", "The unlaggiest Multiblock ever!", "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", "of it depends on the amount of", "adjacent Storages. The",
"Storageblocks are NOT TileEntities,", "what means that they cause as much", "Lag as a random Dirtblock. And the", "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", "who says that they lag gets murdered!" }, new ItemStack[] {
null, null, null, new ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"I.D.S.U.", "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", "the Hashcode of the Name from the", "first Player, who opens it's GUI",
"", "It stores up to 1 Billion EU", "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"A.E.S.U.", "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.",
"", "", "", "", "", "", "" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Charge-O-Mat", "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station",
"even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Centrifuge", "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,",
"which you put in the Top Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Electrolyzer", "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", "on the Recipe you use.", "",
"It needs Tin Cells for some Recipes,", "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Grinder", "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,",
"which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), null, null, null, null, null,
null, null, null, null });*/
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Electric Blast Furnace", "You may know the Blast Furnace", "of Railcraft. This one works", "similar, as it can also produce", "Steel out of Iron and Coal.", "", "Its heat Capacity depends on the", "used Machine Casings for building", "it. The better they are, the more", "Heat it can achieve.",
"", "Top = Input 1", "Bottom = Input 2", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
- null, null, null, null, ItemList.Machine_Multi_BlastFurnace.get(1), null, null, null, null, null,
- null, null, null, null });
- /* new GT_ComputercubeDescription(new String[] {
+ null, null, null, ItemList.Casing_HeatProof.get(1), ItemList.Machine_Multi_BlastFurnace.get(1), ItemList.Casing_Coil_Cupronickel.get(1), ItemList.Casing_Coil_Kanthal.get(1), ItemList.Casing_Coil_Nichrome.get(1), ItemList.Casing_Coil_TungstenSteel.get(1), ItemList.Casing_Coil_HSSG.get(1),
+ ItemList.Casing_Coil_HSSS.get(1), ItemList.Casing_Coil_Naquadah.get(1), ItemList.Casing_Coil_NaquadahAlloy.get(1), null });
+ /* new GT_Computercube_Description(new String[] {
"Sawmill", "This Device turns your Logs", "into more Planks, than a normal", "Steve can produce with his Hands.", "", "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", "", "It needs Water for most Recipes,",
"which you put in the Bottom Left Slot", "Top = Input", "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
null, null, GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null,
null, null, null, null });*/
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Implosion Compressor", "You need to turn Dusts back", "into Gems? Or do you just want", "to make Iridium Plates?", "With a bit ITNT you can achieve", "that in this Device!", "", "We strongly recommend to use", "Flint Dust instead of Flints", "for making the ITNT.",
"", "Top = Input", "Explosion Sides = Output", "ITNT Side = ITNT Input", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
null, null, null, GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)), ItemList.Machine_Multi_ImplosionCompressor.get(1), null, null, null, null, null,
null, null, null, null });
- /* new GT_ComputercubeDescription(new String[] {
+ /* new GT_Computercube_Description(new String[] {
"Superconductor", "Expensive, but superconducting", "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down",
"to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] {
null, null, GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Player Detector", "This nice little Device is able", "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", "and ALL Players by Rightclicking it.", "",
"It doesnt detect regular Mobs.", "", "", "", "", "", "~This Device has private Access~" }, new ItemStack[] {
null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null,
null, null, null, null });*/
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Matter Fabricator", "The Matter Fabricator is nothing", "else than a Mass Fabricator, which", "can ONLY run on Scrap and other", "Amplifiers.", "", "With the Default Config it is 100", "times more expensive than normal.", "Of course you can set the Config", "to 166666, to get your normal",
"Massfabricationrate back, or you", "could make Mass Fabrication even", "cheaper, if you really want to", "make Mass Fabrication that easy", "", "", "" }, new ItemStack[] {
- null, null, null, GT_Utility.getFluidDisplayStack(FluidUtils.getUUA(1), false), ItemList.Machine_LV_Massfab.get(1), null, null, null, null, null,
+ null, null, null, GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false), ItemList.Machine_LV_Massfab.get(1), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Electric Autocrafting Tables", "These are Crafting Tables for the", "common need of autocrafting in", "Factories. One Craft needs 5000EU to", "be performed, so you have actually to", "lay Wires to it. This Table is", "unique as its also able, to give you", "the used Capsulecellcontainers, made", "by Industrial Corp, back.", "You may use that behaviour to",
"craft anything releated to chemics,", "like the 2xKNO3-Recipe for Saltpeter.", "The 5 Modes are the following:", "1. Craft Recipe, 2. All 5 Modes", "3. Craft all as single Items", "4. 2x2-Grid and 5. a 3x3-Grid.", "It accepts only 32EU/p as Input." }, new ItemStack[] {
null, null, null, null, GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1), null, null, null, null, null,
null, null, null, null });
- /* new GT_ComputercubeDescription(new String[] {
+ /* new GT_Computercube_Description(new String[] {
"Automation with GregTech", "Translocators and Buffers are the", "newest Way to automate your Machines.", "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", "for things, like saving wires.", "Translocators are taking Stuff from", "the Block at their green Inputfacing",
"and putting it into the Block at the", "red Outputfacing. Buffers do the same,", "but the grab Items from their own", "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", "which you can configure in their GUI." }, new ItemStack[] {
null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Silver Ore", "It's rarity is similar to Gold", "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", "",
"", "", "", "", "", "", "" }, new ItemStack[] {
null, null, GT_OreDictUnificator.get("dustSilver", 1), GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Sapphires and Rubys", "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", "Lapotroncrystals, but they are", "Redpower Compatible.",
"", "They also sometimes drop random", "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new ItemStack[] {
null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Bauxite Ore", "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", "then note, that mobs NEVER spawn", "ontop of an Aluminium Block",
"(Same applies also for Silver-,", "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] {
new ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Titanium", "Produced by centrifuging Bauxitedust", "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", "mixed Metal Ingots",
"", "", "", "", "", "", "" }, new ItemStack[] {
new ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Iridium Ore", "You can find it only when you", "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", "for Iridium, for making getting it", "an Achievement.",
"", "However Iridium Ore contains traces", "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] {
null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Helium Coolant Cell", "These are just cheaper, than the", "Water based Coolant Cells, and can", "also hold six times more Heat.", "", "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "",
"", "", "", "", "", "", "" }, new ItemStack[] {
GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Destructopack", "Open its GUI via rightclick and", "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", "", "", "", "", "",
"", "", "", "", "", "", "" }, new ItemStack[] {
null, null, null, null, GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null,
null, null, null, null });*/
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Data Orbs", "They store Data.", "", "Rightclick on a Computer Cube, to", "extract a Reactorplan", "", "Sneak-Rightclick on it, to insert", "a Reactorplan", "", "Works also with Sonictrons",
"", "", "", "", "", "", "" }, new ItemStack[] {
null, null, null, null, ItemList.Tool_DataOrb.get(1), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
- "Energy Orbs", "10Million EU in one Orb!", "", "This is a Tier-IV-Energystorage", "So a MFSU is not enough for it!", "", "Use it to create a Lapotron Pack,", "which is like an ultimate Lap Pack!", "", "",
+ new GT_Computercube_Description(new String[] {
+ "Energy Orbs", "100 Million EU in one Orb!", "", "This is a Tier-IV-Energystorage", "So a MFSU is not enough for it!", "", "Use it to create a Lapotron Pack,", "which is like an ultimate Lap Pack!", "", "",
"", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, null, ItemList.Energy_LapotronicOrb.get(1), null, null, null, null, null, null,
+ null, null, null, null, ItemList.Energy_LapotronicOrb.get(1), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Iridium Neutron Reflector", "It's used for Fusion Reactor Coils,", "and works like a normal one", "inside a Reactor, but it's also", "INDESTRUCTIBLE*.", "", "", "", "", "",
"", "", "", "", "", "", "* = for weardown" }, new ItemStack[] {
null, null, null, null, ItemList.Neutron_Reflector.get(1), null, null, null, null, null,
null, null, null, null });
- /*new GT_ComputercubeDescription(new String[] {
+ /*new GT_Computercube_Description(new String[] {
"Rock Cutter", "You want to get whole Blocks, but", "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "",
"Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", "Grinder to get even more", "Resources!", "" }, new ItemStack[] {
null, null, null, null, GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null,
null, null, null, null });
- new GT_ComputercubeDescription(new String[] {
+ new GT_Computercube_Description(new String[] {
"Tesla Staff", "This completly untested PvP-Weapon", "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", "while using it.",
"", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, new ItemStack[] {
null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, null,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
index 59e6e78757..1a66698982 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
@@ -486,7 +486,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) {
+ int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
// Based on the Processing Array. A bit overkill, but very flexible.
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
index 5ff8330372..1d6d490fdf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
@@ -1,19 +1,18 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.lang3.ArrayUtils;
+
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-import gregtech.api.metatileentity.implementations.*;
-import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import gtPlusPlus.core.lib.CORE;
-import org.apache.commons.lang3.ArrayUtils;
import gregtech.api.GregTech_API;
import gregtech.api.enums.TAE;
@@ -21,10 +20,16 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
@@ -233,6 +238,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase
return super.checkRecipeGeneric();
}
+ @Override
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
index f016288547..99386622a9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
@@ -1,10 +1,17 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+
import java.util.ArrayList;
import java.util.Collection;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -13,10 +20,21 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
@@ -31,10 +49,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-
public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase {
public static int sUUAperUUM = 1;
@@ -353,14 +367,19 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo
return true;
}
- return super.checkRecipeGeneric(c, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll, true);
+ return super.checkRecipeGeneric(c, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll);
}
//Return normal Recipe handling
- return super.checkRecipeGeneric(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll, true);
+ return super.checkRecipeGeneric(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll);
}
@Override
+ public boolean hasPerfectOverclock() {
+ return true;
+ }
+
+ @Override
public int getMaxParallelRecipes() {
return this.mMode == MODE_SCRAP ? 32 : 2 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage())));
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
index 42912c4fa8..fe3ec43011 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -577,7 +577,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) {
+ int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
// Based on the Processing Array. A bit overkill, but very flexible.
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
index 11d5068374..033a5f925b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections;
import Ic2ExpReactorPlanner.SimulationData;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
@@ -12,37 +13,26 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.bartworks.BW_Utils;
-import gtPlusPlus.xmod.goodgenerator.GG_Utils;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_ComputerCube;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_ComputerCube;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputercubeDescription;
+import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description;
import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Simulator;
-import ic2.api.reactor.IReactor;
-import ic2.api.reactor.IReactorComponent;
import ic2.core.Ic2Items;
-import ic2.core.init.MainConfig;
-import ic2.core.util.ConfigUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank implements IReactor {
+public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
public static boolean mSeedscanner = true;
@@ -56,11 +46,11 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
public int mHeat = 0;
- public int mEUOut = 0;
+ public long mEUOut = 0;
public int mMaxHeat = 10000;
- public int mEU = 0;
+ public long mEU = 0;
public int mProgress = 0;
@@ -90,24 +80,14 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
@Override
public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- try {
- return new GT_Container_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
- }
- catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
+ Logger.INFO("CC-Sever ID: "+aID);
+ return new GT_Container_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
}
@Override
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- try {
- return new GT_GUIContainer_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
- }
- catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
+ Logger.INFO("CC-Client ID: "+aID);
+ return new GT_GUIContainer_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
}
@Override
@@ -115,9 +95,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
if (aBaseMetaTileEntity.isClientSide()) {
return true;
}
- Logger.INFO("Did rmb.");
- boolean aDidOpen = aBaseMetaTileEntity.openGUI(aPlayer);
- Logger.INFO("Did open? "+aDidOpen);
+ aBaseMetaTileEntity.openGUI(aPlayer, mMode);
return true;
}
@@ -284,123 +262,123 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
if (this.mMode == 6) {
showElectrolyzerRecipe(0);
}
- //this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), (GregTech_API.sBlockList[1]), 10, this.mMode);
- //this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), (GregTech_API.sBlockList[1]), 11, this.mMaxHeat);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
}
public void showDescription(int aIndex) {
this.mExplosionStrength = 0.0F;
- if (GT_ComputercubeDescription.sDescriptions.isEmpty()) {
+ if (GT_Computercube_Description.sDescriptions.isEmpty()) {
return;
}
- if (aIndex >= GT_ComputercubeDescription.sDescriptions.size() || aIndex < 0)
+ if (aIndex >= GT_Computercube_Description.sDescriptions.size() || aIndex < 0)
aIndex = 0;
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[0] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0] == null) {
this.mInventory[59] = null;
}
else {
- this.mInventory[59] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[0].copy();
+ this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0].copy();
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[1] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1] == null) {
this.mInventory[60] = null;
}
else {
- this.mInventory[60] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[1].copy();
+ this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1].copy();
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[2] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2] == null) {
this.mInventory[61] = null;
}
else {
- this.mInventory[61] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[2].copy();
+ this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2].copy();
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[3] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3] == null) {
this.mInventory[62] = null;
}
else {
- this.mInventory[62] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[3].copy();
+ this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3].copy();
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[4] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4] == null) {
this.mInventory[63] = null;
}
else {
- this.mInventory[63] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[4].copy();
+ this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4].copy();
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[5] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5] == null) {
this.mInventory[64] = null;
}
else {
- this.mInventory[64] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[5].copy();
+ this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[6] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6] == null) {
this.mInventory[65] = null;
}
else {
- this.mInventory[65] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[6].copy();
+ this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[7] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7] == null) {
this.mInventory[66] = null;
}
else {
- this.mInventory[66] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[7].copy();
+ this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[8] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8] == null) {
this.mInventory[67] = null;
}
else {
- this.mInventory[67] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[8].copy();
+ this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[9] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9] == null) {
this.mInventory[68] = null;
}
else {
- this.mInventory[68] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[9].copy();
+ this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[10] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10] == null) {
this.mInventory[69] = null;
}
else {
- this.mInventory[69] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[10].copy();
+ this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[11] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11] == null) {
this.mInventory[70] = null;
}
else {
- this.mInventory[70] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[11].copy();
+ this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[12] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12] == null) {
this.mInventory[71] = null;
}
else {
- this.mInventory[71] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[12].copy();
+ this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12].copy();
this.mExplosionStrength = 100.0F;
}
- if (((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[13] == null) {
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13] == null) {
this.mInventory[72] = null;
}
else {
- this.mInventory[72] = ((GT_ComputercubeDescription) GT_ComputercubeDescription.sDescriptions.get(aIndex)).mStacks[13].copy();
+ this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13].copy();
this.mExplosionStrength = 100.0F;
}
this.mMaxHeat = aIndex;
- //this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockList[1], 11, this.mMaxHeat);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
}
public void switchDescriptionPageForward() {
- if (++this.mMaxHeat >= GT_ComputercubeDescription.sDescriptions.size())
+ if (++this.mMaxHeat >= GT_Computercube_Description.sDescriptions.size())
this.mMaxHeat = 0;
showDescription(this.mMaxHeat);
}
public void switchDescriptionPageBackward() {
if (--this.mMaxHeat < 0)
- this.mMaxHeat = GT_ComputercubeDescription.sDescriptions.size() - 1;
+ this.mMaxHeat = GT_Computercube_Description.sDescriptions.size() - 1;
showDescription(this.mMaxHeat);
}
@@ -563,7 +541,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
this.mHeat = tRecipe.mDuration;
this.mMaxHeat = aIndex;
}
- //this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockList[1], 11, this.mMaxHeat);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
}
public void switchFusionPageForward() {
@@ -599,33 +577,42 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
mSimulator.simulate();
}
- public void storeAdditionalData(NBTTagCompound aNBT) {
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
aNBT.setInteger("mMode", this.mMode);
aNBT.setInteger("mProgress", this.mProgress);
aNBT.setBoolean("mStarted", this.mStarted);
- aNBT.setInteger("mEU", this.mEU);
+ int[] aSplitLong1 = MathUtils.splitLongIntoTwoIntegers(mEU);
+ aNBT.setInteger("mEU1", aSplitLong1[0]);
+ aNBT.setInteger("mEU2", aSplitLong1[1]);
aNBT.setInteger("mHeat", this.mHeat);
- aNBT.setInteger("mEUOut", this.mEUOut);
+ int[] aSplitLong2 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
+ aNBT.setInteger("mEUOut1", aSplitLong2[0]);
+ aNBT.setInteger("mEUOut2", aSplitLong2[1]);
aNBT.setInteger("mMaxHeat", this.mMaxHeat);
aNBT.setFloat("mHEM", this.mHEM);
aNBT.setFloat("mExplosionStrength", this.mExplosionStrength);
}
- public void getAdditionalData(NBTTagCompound aNBT) {
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
this.mMode = aNBT.getInteger("mMode");
this.mProgress = aNBT.getInteger("mProgress");
this.mStarted = aNBT.getBoolean("mStarted");
- this.mEU = aNBT.getInteger("mEU");
+ int partA = aNBT.getInteger("mEU1");
+ int partB = aNBT.getInteger("mEU2");
+ this.mEU = MathUtils.combineTwoIntegersToLong(partA, partB);
this.mHeat = aNBT.getInteger("mHeat");
- this.mEUOut = aNBT.getInteger("mEUOut");
+ partA = aNBT.getInteger("mEUOut1");
+ partB = aNBT.getInteger("mEUOut2");
+ this.mEUOut = MathUtils.combineTwoIntegersToLong(partA, partB);
this.mMaxHeat = aNBT.getInteger("mMaxHeat");
this.mHEM = aNBT.getFloat("mHEM");
this.mExplosionStrength = aNBT.getFloat("mExplosionStrength");
}
- public void onFirstTickUpdate() {
- }
-
@Override
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
super.onFirstTick(aBaseMetaTileEntity);
@@ -634,6 +621,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
+
if (mSimulator == null) {
mSimulator = new GT_Computercube_Simulator(this);
}
@@ -741,16 +729,12 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
this.mEUOut = (this.mEUOut + this.mEULast1 + this.mEULast2 + this.mEULast3 + tEU) / 5;
}*/
if (aTick % 20L == 0L) {
- //this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 10, this.mMode);
- //this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode);
+ this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
}
}
}
- private int getReactorEUOutput() {
- return MathUtils.roundToClosestInt(getReactorEnergyOutput() * 5.0F * ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear"));
- }
-
@Override
public void receiveClientEvent(byte aEventID, byte aValue) {
super.receiveClientEvent(aEventID, aValue);
@@ -779,151 +763,21 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl
this.mNeedsUpdate = true;
}
+ @Override
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
return (this.mMode == 2) ? ((i == 54 || i == 55)) : false;
}
+ @Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
return (this.mMode == 2) ? ((i == 56 || i == 57)) : false;
}
- public String getInvName() {
- return "GregTech_Computercube";
- }
-
- public int getTexture(int aSide, int aMeta) {
- switch (this.mMode) {
- case 0 :
- return 8;
- case 1 :
- return 46;
- case 2 :
- return 45;
- }
- return 48;
- }
-
- @Override
- public ChunkCoordinates getPosition() {
- return new ChunkCoordinates(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord());
- }
-
- @Override
- public int getHeat() {
- return this.mHeat;
- }
-
- @Override
- public void setHeat(int aHeat) {
- this.mHeat = aHeat;
- }
-
- @Override
- public int addHeat(int aAmount) {
- this.mHeat += aAmount;
- return this.mHeat;
- }
-
- @Override
- public int getMaxHeat() {
- return this.mMaxHeat;
- }
-
- @Override
- public void setMaxHeat(int aMaxHeat) {
- this.mMaxHeat = aMaxHeat;
- }
-
- @Override
- public float getHeatEffectModifier() {
- return this.mHEM;
- }
-
- @Override
- public void setHeatEffectModifier(float aHEM) {
- this.mHEM = aHEM;
- }
-
-
- public int addOutput(int aEnergy) {
- this.mEUOut += aEnergy;
- return this.mEUOut;
- }
-
- @Override
- public ItemStack getItemAt(int x, int y) {
- if (x < 0 || x > 8 || y < 0 || y > 5)
- return null;
- return getStackInSlot(x + y * 9);
- }
-
- @Override
- public void setItemAt(int x, int y, ItemStack aStack) {
- setInventorySlotContents(x + y * 9, aStack);
- }
-
- @Override
- public void explode() {
- stopNuclearReactor();
- }
-
- @Override
- public int getTickRate() {
- return 1;
- }
-
- @Override
- public boolean produceEnergy() {
- return true;
- }
-
- public int getProgress() {
- return this.mProgress;
- }
-
- public int getMaxProgress() {
- return (this.mProgress > 0) ? 100 : 0;
- }
-
- @Override
- public float addOutput(float aEnergy) {
- this.mEUOut = (int) (this.mEUOut + aEnergy);
- return this.mEUOut;
- }
-
- @Override
public World getWorld() {
return this.getBaseMetaTileEntity().getWorld();
}
@Override
- public void addEmitHeat(int heat) {
-
- }
-
- @Override
- public float getReactorEnergyOutput() {
- return this.mEUOut;
- }
-
- @Override
- public double getReactorEUEnergyOutput() {
- return 0;
- }
-
- @Override
- public void setRedstoneSignal(boolean redstone) {
-
- }
-
- @Override
- public boolean isFluidCooled() {
- return false;
- }
-
-
-
- @Override
public boolean doesFillContainers() {
return false;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
index 5c34ce70fe..c4a27079f7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
@@ -5,7 +5,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputercubeDescription;
+import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricAutoWorkbench;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricInventoryManager;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;