Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Should Fix CAL Overclocking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bartimaeusnek committed Dec 19, 2020
1 parent d96fd88 commit 02d7c22
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
majorUpdate=0
minorUpdate=5
buildNumber=13.1
buildNumber=14
apiVersion=11
ic2Version=2.2.828-experimental
applecoreVersion=1.7.10-3.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,7 @@ public boolean checkRecipe(ItemStack itemStack) {
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;
}

Expand All @@ -153,20 +144,25 @@ public boolean checkRecipe(ItemStack itemStack) {
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;
Expand Down Expand Up @@ -349,28 +345,35 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,6 @@ private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt,
}
}

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;
Expand Down

0 comments on commit 02d7c22

Please sign in to comment.