diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-12-02 20:44:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 13:44:22 +0100 |
commit | 1ffa67ff2fd281ced2a276c28cf33e8a8a703d68 (patch) | |
tree | 1d5f5455353b1c09f39c3ab228151046118824c6 /src/main/java | |
parent | 6f6af0b1aeace22e84f6097c33aff1adfb660fad (diff) | |
download | GT5-Unofficial-1ffa67ff2fd281ced2a276c28cf33e8a8a703d68.tar.gz GT5-Unofficial-1ffa67ff2fd281ced2a276c28cf33e8a8a703d68.tar.bz2 GT5-Unofficial-1ffa67ff2fd281ced2a276c28cf33e8a8a703d68.zip |
reduce replicator power consumption by 1/16 to allow cable loss (#1532)
Diffstat (limited to 'src/main/java')
3 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java index 99b49d1c78..41e506273d 100644 --- a/src/main/java/gregtech/api/enums/GT_Values.java +++ b/src/main/java/gregtech/api/enums/GT_Values.java @@ -5,6 +5,8 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.internal.IGT_Mod; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.net.IGT_NetworkHandler; +import java.math.BigInteger; +import java.util.Arrays; import java.util.HashSet; import java.util.Locale; import java.util.Set; @@ -92,6 +94,18 @@ public class GT_Values { // Error tier to prevent out of bounds errors. Not really a real tier (for now). 8_589_934_592L }; + + /** + * The Voltage Practical. These are recipe voltage you should use if you expect the recipe to use a full amp of + * that tier. These leave a bit of headroom for cable and transformer losses, but not enough to make it a great gain. + */ + // this will correctly map ULV to 7. + public static final long[] VP = Arrays.stream(V) + .map(i -> BigInteger.valueOf(i) + .multiply(BigInteger.valueOf(30)) + .divide(BigInteger.valueOf(32)) + .longValueExact()) + .toArray(); // Why -7? Mystery of the universe. Something may break if you change this so please do not without extensive // testing. // TODO:Adding that in coremod!!! diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 24f49ada10..57536d0e9d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -135,7 +135,7 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine long tMass = cubicFluidMultiplier(MASS_OVERRIDES.getOrDefault(tMaterial, tMaterial.getMass())); if ((tFluid.amount >= tMass) && (tMass > 0L)) { - this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier], 1); + this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.VP[this.mTier], 1); this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1L << this.mTier), 1); if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; diff --git a/src/main/java/gregtech/loaders/postload/GT_PostLoad.java b/src/main/java/gregtech/loaders/postload/GT_PostLoad.java index 3d38488393..585857c50a 100644 --- a/src/main/java/gregtech/loaders/postload/GT_PostLoad.java +++ b/src/main/java/gregtech/loaders/postload/GT_PostLoad.java @@ -1,6 +1,7 @@ package gregtech.loaders.postload; import static gregtech.api.enums.GT_Values.MOD_ID_FR; +import static gregtech.api.enums.GT_Values.VP; import com.google.common.base.Stopwatch; import cpw.mods.fml.common.Loader; @@ -279,7 +280,7 @@ public class GT_PostLoad { new FluidStack[] {Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), - 30, + (int) VP[1], 0); } tInput = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L); @@ -303,7 +304,7 @@ public class GT_PostLoad { new FluidStack[] {Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), - 30, + (int) VP[1], 0); } } |