aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-06-12 23:56:57 +0900
committerGitHub <noreply@github.com>2022-06-12 16:56:57 +0200
commit003055356c460c8bdc99f8346bebd65b5a1c3343 (patch)
tree052737c3989263e374e4c6944d77f8febb34acbd /src
parent5215dcf030d878261a13fad47239137889cc09bf (diff)
downloadGT5-Unofficial-003055356c460c8bdc99f8346bebd65b5a1c3343.tar.gz
GT5-Unofficial-003055356c460c8bdc99f8346bebd65b5a1c3343.tar.bz2
GT5-Unofficial-003055356c460c8bdc99f8346bebd65b5a1c3343.zip
Use getMaxInputVoltage for finding recipes in Precise Assembler (#47)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
index 27514fe7fc..d1306110df 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
@@ -198,7 +198,7 @@ public class PreciseAssembler extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
if (this.mode == 0) {
for (GT_MetaTileEntity_Hatch_InputBus bus : mInputBusses) {
if (!isValidMetaTileEntity(bus)) continue;
- GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
+ GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputEnergyPA()), inputFluids, getStoredItemFromHatch(bus));
if (tRecipe != null && tRecipe.mSpecialValue <= casingTier) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
@@ -216,7 +216,7 @@ public class PreciseAssembler extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
else {
for (GT_MetaTileEntity_Hatch_InputBus bus : mInputBusses) {
if (!isValidMetaTileEntity(bus) || getStoredItemFromHatch(bus).length < 1) continue;
- GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputVoltage()), inputFluids, getStoredItemFromHatch(bus));
+ GT_Recipe tRecipe = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Math.min(getMachineVoltageLimit(), getMaxInputEnergyPA()), inputFluids, getStoredItemFromHatch(bus));
if (tRecipe != null) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
@@ -245,6 +245,28 @@ public class PreciseAssembler extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
return false;
}
+ /**
+ * Modified version of {@link #getMaxInputEnergy()}
+ */
+ private long getMaxInputEnergyPA() {
+ long rEnergy = 0;
+ if (mEnergyHatches.size() == 1) {
+ // it works like most of the 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();
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.getBaseMetaTileEntity().getInputAmperage();
+ }
+ }
+ return rEnergy;
+ }
+
@Override
public int getMaxEfficiency(ItemStack aStack) {
return 10000;