diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-12-19 15:53:07 +0100 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-12-19 15:53:07 +0100 |
commit | 9116ad21d98496312d0ad7567574f609304d4f07 (patch) | |
tree | e7d657a6ee9d6b486cc1f841bd05c1fa1d47ad5a /src/main/java/com | |
parent | 171fb79478302114847b0c510d8bba7e51d7f9fe (diff) | |
download | GT5-Unofficial-9116ad21d98496312d0ad7567574f609304d4f07.tar.gz GT5-Unofficial-9116ad21d98496312d0ad7567574f609304d4f07.tar.bz2 GT5-Unofficial-9116ad21d98496312d0ad7567574f609304d4f07.zip |
Should Fix CAL Overclocking issues
Former-commit-id: 70f4866ed5d4d025925f0ac9d118f7813402c24c
Diffstat (limited to 'src/main/java/com')
2 files changed, 38 insertions, 39 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 9de9f736cb..8552aa14d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -121,16 +121,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return false; if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { - BW_Util.calculateOverclockedNessMultiPefectOC(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = this.bufferedRecipe.mOutputs; - this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; - sendLoopStart((byte) 20); - this.updateSlots(); + setRecipeStats(); return true; } @@ -153,20 +144,25 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl else continue; - BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = this.bufferedRecipe.mOutputs; - this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; - this.updateSlots(); + this.setRecipeStats(); return true; } return false; } + private void setRecipeStats() { + BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = this.bufferedRecipe.mOutputs; + this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + sendLoopStart((byte) 20); + this.updateSlots(); + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; @@ -349,28 +345,35 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return new GT_TileEntity_CircuitAssemblyLine(this.mName); } + private static final String[] DESCRIPTION = new String[]{ + "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", + "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", + "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", + "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", + "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", + "Up to 7 repeating slices, last is Output Bus", + "Imprint this machine with a Circuit Imprint,", + "by putting the imprint in the controller.", + "Every Circuit Assembly Line can only be imprinted ONCE.", + ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; + @Override public String[] getDescription() { - return new String[]{ - "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", - "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", - "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", - "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", - "Up to 7 repeating slices, last is Output Bus", - "Imprint this machine with a Circuit Imprint,", - "by putting the imprint in the controller.", - "Every Circuit Assembly Line can only be imprinted ONCE.", - ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return DESCRIPTION; } + private String[] infoDataBuffer; @Override public String[] getInfoData() { - String[] ret = new String[super.getInfoData().length+1]; - System.arraycopy(super.getInfoData(),0,ret,0,super.getInfoData().length); - ret[super.getInfoData().length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); - return ret; + if (infoDataBuffer != null) + return infoDataBuffer; + + String[] oldInfo = super.getInfoData(); + infoDataBuffer = new String[oldInfo.length+1]; + System.arraycopy(oldInfo,0,infoDataBuffer,0, oldInfo.length); + infoDataBuffer[oldInfo.length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + return infoDataBuffer; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f8b0aac053..21790bfe41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -413,10 +413,6 @@ public class BW_Util { } } - public static void calculateOverclockedNessMultiPefectOC(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base){ - calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, 1); - } - public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; |