Skip to content

Commit 10c9cf2

Browse files
committed
Fix large combustion engines saying "Running Perfectly" when the dynamo hatch is full
1 parent b95a817 commit 10c9cf2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/gregtech/common/metatileentities/multi/electric/generator/MetaTileEntityLargeCombustionEngine.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
7777
protected void configureDisplayText(MultiblockUIBuilder builder) {
7878
var recipeLogic = (LargeCombustionEngineWorkableHandler) recipeMapWorkable;
7979

80-
builder.setWorkingStatus(recipeLogic.isWorkingEnabled(), recipeLogic.isActive());
80+
builder.setWorkingStatus(recipeLogic.isWorkingEnabled(), recipeLogic.isActive() && !isDynamoFull());
8181

8282
if (isExtreme) {
8383
builder.addEnergyProductionLine(GTValues.V[tier + 1], recipeLogic.getRecipeEUt());
@@ -123,8 +123,7 @@ protected void configureErrorText(MultiblockUIBuilder builder) {
123123
protected void configureWarningText(MultiblockUIBuilder builder) {
124124
super.configureWarningText(builder);
125125
builder.addCustom((manager, syncer) -> {
126-
long canInsert = syncer.syncLong(getEnergyContainer().getEnergyCanBeInserted());
127-
if (canInsert < syncer.syncLong(recipeMapWorkable.getRecipeEUt())) {
126+
if (syncer.syncBoolean(this::isDynamoFull)) {
128127
manager.add(KeyUtil.lang(TextFormatting.YELLOW,
129128
"gregtech.multiblock.large_combustion_engine.dynamo_hatch_full"));
130129
}
@@ -366,6 +365,10 @@ private int[] getOxygenAmount() {
366365
return new int[2];
367366
}
368367

368+
public boolean isDynamoFull() {
369+
return getEnergyContainer().getEnergyCanBeInserted() < recipeMapWorkable.getRecipeEUt();
370+
}
371+
369372
private static class LargeCombustionEngineWorkableHandler extends MultiblockFuelRecipeLogic {
370373

371374
private boolean isOxygenBoosted = false;

0 commit comments

Comments
 (0)