diff options
author | korneel vandamme <krampus.sack.never@gmail.com> | 2019-12-08 15:51:59 +0100 |
---|---|---|
committer | korneel vandamme <krampus.sack.never@gmail.com> | 2019-12-08 15:51:59 +0100 |
commit | 323403172788232dbe07d02427a670e69e7a0834 (patch) | |
tree | d44ca141893957666c220fd2e61cd9ff067eec14 /src/Java/gtPlusPlus/xmod/gregtech/api | |
parent | 584ebeaa18fba9de4922b09def9f7cf1b5d31eae (diff) | |
download | GT5-Unofficial-323403172788232dbe07d02427a670e69e7a0834.tar.gz GT5-Unofficial-323403172788232dbe07d02427a670e69e7a0834.tar.bz2 GT5-Unofficial-323403172788232dbe07d02427a670e69e7a0834.zip |
2 hatche now accept 4A coils reduction in paralel
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java | 16 |
1 files changed, 13 insertions, 3 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 3c3345d130..827091301b 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 @@ -974,6 +974,15 @@ GT_MetaTileEntity_MultiBlockBase { * log("GOOD RETURN - 1"); return true; } */ + public long getMaxInputEnergy() { + long rEnergy = 0; + if (mEnergyHatches.size() < 2) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies + return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (isValidMetaTileEntity(tHatch)) rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.getBaseMetaTileEntity().getInputAmperage(); + return rEnergy; + } + public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, @@ -988,6 +997,7 @@ GT_MetaTileEntity_MultiBlockBase { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); log("Running checkRecipeGeneric(0)"); @@ -1021,7 +1031,7 @@ GT_MetaTileEntity_MultiBlockBase { log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; @@ -1231,7 +1241,7 @@ GT_MetaTileEntity_MultiBlockBase { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - + long tEnergy = getMaxInputEnergy(); log("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( @@ -1328,7 +1338,7 @@ GT_MetaTileEntity_MultiBlockBase { log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; |