aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2024-03-24 02:54:15 +0800
committerGitHub <noreply@github.com>2024-03-23 19:54:15 +0100
commit8cbfec19693b580c07602b7da42fba00e1d237fa (patch)
tree3c4f5c2d5828b4b38595be2b754b3c226d62d6b1 /src/main
parent24741182122a2ccbde52c611aaae4a0df6b54ebf (diff)
downloadGT5-Unofficial-8cbfec19693b580c07602b7da42fba00e1d237fa.tar.gz
GT5-Unofficial-8cbfec19693b580c07602b7da42fba00e1d237fa.tar.bz2
GT5-Unofficial-8cbfec19693b580c07602b7da42fba00e1d237fa.zip
bandaid fix for NA lag when off (#247)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java b/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java
index 3b77aaf616..7053c01064 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java
@@ -317,14 +317,8 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
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) {
@@ -354,10 +348,21 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
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);