aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
diff options
context:
space:
mode:
authorYang Xizhi <60341015+GlodBlock@users.noreply.github.com>2022-12-01 00:46:46 +0800
committerGitHub <noreply@github.com>2022-11-30 17:46:46 +0100
commit6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39 (patch)
tree938023411758f9ff49d43cfeec8ca271da9a374c /src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
parentf985e28ae553428945f3ce3841ac036c98266128 (diff)
downloadGT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.tar.gz
GT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.tar.bz2
GT5-Unofficial-6bb784072e3e1c7dc23e0964e7ea8a67d0a77c39.zip
clean the long power use base and add item util for tiered material (#108)
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java35
1 files changed, 5 insertions, 30 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
index aaec87d75c..7e2f9efbd1 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java
@@ -203,7 +203,7 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
this.getBaseMetaTileEntity(),
this.lastRecipe,
false,
- Math.min(getMachineVoltageLimit(), getMaxInputEnergyPA()),
+ Math.min(getMachineVoltageLimit(), getRealVoltage()),
inputFluids,
getStoredItemFromHatch(bus));
if (this.lastRecipe != null && this.lastRecipe.mSpecialValue <= (casingTier + 1)) {
@@ -211,8 +211,7 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
this.mEfficiencyIncrease = 10000;
this.lastRecipe.isRecipeInputEqual(true, inputFluids, getStoredItemFromHatch(bus));
mOutputItems = this.lastRecipe.mOutputs;
- calculateOverclockedNessMulti(
- this.lastRecipe.mEUt, this.lastRecipe.mDuration, 1, getMaxInputEnergyPA());
+ calculateOverclockedNessMulti(this.lastRecipe.mEUt, this.lastRecipe.mDuration, 1, getRealVoltage());
this.updateSlots();
if (this.lEUt > 0) {
this.lEUt = (-this.lEUt);
@@ -228,13 +227,13 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
this.getBaseMetaTileEntity(),
this.lastRecipe,
false,
- Math.min(getMachineVoltageLimit(), getMaxInputEnergyPA()),
+ Math.min(getMachineVoltageLimit(), getRealVoltage()),
inputFluids,
getStoredItemFromHatch(bus));
if (this.lastRecipe != null) {
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
- long fullInput = getMaxInputEnergyPA();
+ long fullInput = getRealVoltage();
int pall = handleParallelRecipe(this.lastRecipe, inputFluids, getStoredItemFromHatch(bus), (int)
Math.min((long) Math.pow(2, 4 + (casingTier + 1)), fullInput / this.lastRecipe.mEUt));
if (pall <= 0) continue;
@@ -244,7 +243,7 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
(long) this.lastRecipe.mEUt * (long) pall,
this.lastRecipe.mDuration / 2,
1,
- getMaxInputEnergyPA());
+ getRealVoltage());
this.updateSlots();
if (this.lEUt > 0) {
this.lEUt = (-this.lEUt);
@@ -256,25 +255,6 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
return false;
}
- 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.maxEUInput() * tHatch.maxAmperesIn();
- }
- }
- for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- rEnergy += tHatch.maxEUInput() * ((GT_MetaTileEntity_Hatch_EnergyMulti) tHatch).Amperes;
- }
- }
- return rEnergy;
- }
-
@Override
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
@@ -302,11 +282,6 @@ public class PreciseAssembler extends GT_MetaTileEntity_LongPowerUsageBase<Preci
}
@Override
- protected long getRealVoltage() {
- return getMaxInputEnergyPA();
- }
-
- @Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
buildPiece(mName, stackSize, hintsOnly, 4, 4, 0);
}