aboutsummaryrefslogtreecommitdiff
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
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)
-rw-r--r--dependencies.gradle2
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java26
2 files changed, 25 insertions, 3 deletions
diff --git a/dependencies.gradle b/dependencies.gradle
index 38af523d6c..bc6fed5282 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -4,7 +4,7 @@ dependencies {
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.41:dev')
compile('com.github.GTNewHorizons:StructureLib:1.0.15:dev')
compile('com.github.GTNewHorizons:bartworks:0.5.37:dev')
- compile('com.github.GTNewHorizons:NotEnoughItems:2.2.7-GTNH:dev')
+ compile('com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev')
compile('com.github.GTNewHorizons:TecTech:5.0.5.1:dev')
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
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;