Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
bandaid fix for NA lag when off
Browse files Browse the repository at this point in the history
  • Loading branch information
Glease committed Mar 23, 2024
1 parent 2474118 commit 14954c5
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
boolean anyWorking = false;
if (aBaseMetaTileEntity.isServerSide()) {
startRecipeProcessing();
for (ItemStack input : getStoredInputs()) {
if (input.isItemEqual(Materials.Graphite.getDust(1))
|| input.isItemEqual(Materials.Beryllium.getDust(1))) {
int consume = Math.min(this.eV / 10000000, input.stackSize);
depleteInput(GT_Utility.copyAmount(consume, input));
this.eV -= 10000000 * consume;
}
if (this.eV > 0 && (aTick % 20 == 0 || eV > mCeil)) {
tryUseModerator();
}

for (NeutronAccelerator tHatch : mNeutronAccelerator) {
Expand Down Expand Up @@ -354,10 +348,21 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
this.mOutputFluids = null;
this.mOutputItems = new ItemStack[] { ItemRefer.Radioactive_Waste.get(4) };
}
endRecipeProcessing();
}
}

private void tryUseModerator() {
startRecipeProcessing();
for (ItemStack input : getStoredInputs()) {
if (input.isItemEqual(Materials.Graphite.getDust(1)) || input.isItemEqual(Materials.Beryllium.getDust(1))) {
int consume = Math.min(this.eV / 10000000, input.stackSize);
depleteInput(GT_Utility.copyAmount(consume, input));
this.eV -= 10000000 * consume;
}
}
endRecipeProcessing();
}

@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
structureBuild_EM(NA_BOTTOM, 2, 0, 0, stackSize, hintsOnly);
Expand Down

0 comments on commit 14954c5

Please sign in to comment.