aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-11-14 23:46:37 +1000
committerAlkalus <draknyte1@hotmail.com>2017-11-14 23:46:37 +1000
commit073da68b48dfad0b813eaa2cdf3fc9ff0d336a65 (patch)
tree38df8cb7984c43eb5c86845a3b75d6bdbd3c774e /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
parent0019986e25da2cb423c46b4e5866a09e0920e9fb (diff)
downloadGT5-Unofficial-073da68b48dfad0b813eaa2cdf3fc9ff0d336a65.tar.gz
GT5-Unofficial-073da68b48dfad0b813eaa2cdf3fc9ff0d336a65.tar.bz2
GT5-Unofficial-073da68b48dfad0b813eaa2cdf3fc9ff0d336a65.zip
Revert "% Changed Wash Plant recipe handling."
This reverts commit 98d4998aafa2f5b6f1ad518b6effe52b6a7c7c18.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java82
1 files changed, 31 insertions, 51 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 8fd640c6e5..576b3c1d04 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -82,58 +82,38 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
public void startProcess() {}
public int getValidOutputSlots(final IGregTechTileEntity machineCalling, final GT_Recipe sRecipes, final ItemStack[] sInputs){
- Utils.LOG_INFO("Finding valid output slots for "+machineCalling.getInventoryName());
-
- try{
-
- if (sRecipes == null){
- return 0;
- }
-
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- final GT_Recipe tRecipe = sRecipes;
- final int outputItemCount;
- if (tRecipe.mOutputs != null){
- outputItemCount= tRecipe.mOutputs.length;
- }
- else {
- outputItemCount= 0;
- }
- int tValidOutputHatches = 0;
-
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (!isValidMetaTileEntity(tHatch)) continue;
-
- int tEmptySlots = 0;
- boolean foundRoom = false;
- final IInventory tHatchInv = tHatch.getBaseMetaTileEntity();
- for(int i = 0; i < tHatchInv.getSizeInventory() && !foundRoom; ++i)
- {
- if(tHatchInv.getStackInSlot(i) != null) continue;
-
- tEmptySlots++;
- if(tEmptySlots < outputItemCount) continue;
-
- tValidOutputHatches++;
- foundRoom = true;
- }
- }
- if (tValidOutputHatches < 0){
- tValidOutputHatches = 0;
- }
-
- return tValidOutputHatches;
- } catch (Throwable t){
- t.printStackTrace();
- return 0;
- }
+ Utils.LOG_WARNING("Finding valid output slots for "+machineCalling.getInventoryName());
+ final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ final GT_Recipe tRecipe = sRecipes;
+ final int outputItemCount = tRecipe.mOutputs.length;
+ int tValidOutputHatches = 0;
+
+ for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
+ if (!isValidMetaTileEntity(tHatch)) continue;
+
+ int tEmptySlots = 0;
+ boolean foundRoom = false;
+ final IInventory tHatchInv = tHatch.getBaseMetaTileEntity();
+ for(int i = 0; i < tHatchInv.getSizeInventory() && !foundRoom; ++i)
+ {
+ if(tHatchInv.getStackInSlot(i) != null) continue;
+
+ tEmptySlots++;
+ if(tEmptySlots < outputItemCount) continue;
+
+ tValidOutputHatches++;
+ foundRoom = true;
+ }
+ }
+
+ return tValidOutputHatches;
}
-
+
public GT_Recipe reduceRecipeTimeByPercentage(GT_Recipe tRecipe, float percentage){
int cloneTime = 0;
GT_Recipe baseRecipe;
GT_Recipe cloneRecipe = null;
-
+
baseRecipe = tRecipe.copy();
if (cloneRecipe != baseRecipe || cloneRecipe == null){
cloneRecipe = baseRecipe.copy();
@@ -143,7 +123,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
cloneTime = baseRecipe.mDuration;
Utils.LOG_WARNING("Setting Time");
}
-
+
if (cloneRecipe.mDuration > 0){
int originalTime = cloneRecipe.mDuration;
int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration, (100-percentage));
@@ -159,9 +139,9 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
}
Utils.LOG_INFO("Error generating recipe, returning null.");
return null;
-
-
-
+
+
+
}