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

Commit

Permalink
Batch mode for compact fusion MKIV-V (#223)
Browse files Browse the repository at this point in the history
* batch mode

* Update en_US.lang

(cherry picked from commit 33566b8)
  • Loading branch information
HoleFish authored and Dream-Master committed Dec 20, 2023
1 parent 0168248 commit a56dc4a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
package goodgenerator.blocks.tileEntity.base;

import static net.minecraft.util.StatCollector.translateToLocal;

import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;

import gregtech.api.logic.ProcessingLogic;

public abstract class LargeFusionComputerPP extends LargeFusionComputer {

protected Parameters.Group.ParameterIn batchSetting;

/** Name of the batch setting */
private static final INameFunction<LargeFusionComputerPP> BATCH_SETTING_NAME = (base,
p) -> translateToLocal("gt.blockmachines.LargeFusionComputerPP.cfgi.0"); // Batch size
/** Status of the batch setting */
private static final IStatusFunction<LargeFusionComputerPP> BATCH_STATUS = (base, p) -> LedStatus
.fromLimitsInclusiveOuterBoundary(p.get(), 1, 0, 32, 128);

public LargeFusionComputerPP(String name) {
super(name);
}
Expand All @@ -23,4 +39,19 @@ protected long getSingleHatchPower() {
return super.getSingleHatchPower() * 8;
}

@Override
protected void parametersInstantiation_EM() {
batchSetting = parametrization.getGroup(9, false).makeInParameter(1, 1, BATCH_SETTING_NAME, BATCH_STATUS);
}

@Override
protected int getMaxBatchSize() {
// Batch size 1~128
return (int) Math.min(Math.max(batchSetting.get(), 1.0D), 128.0D);
}

@Override
public boolean getDefaultBatchMode() {
return true;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/goodgenerator/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ gui.YOTTank.button.void=Void Excess
gui.YOTTank.button.locking=Fluid locking
gui.LargeFusion.0=Energy Capacity:
gui.LargeFusion.1=Stored Energy:
gt.blockmachines.LargeFusionComputerPP.cfgi.0=Batch Size

# RecipeMaps
gg.recipe.naquadah_reactor=Large Naquadah Reactor
Expand Down

0 comments on commit a56dc4a

Please sign in to comment.