Skip to content

Commit c4de479

Browse files
committed
Add active machine mode to UI
1 parent 7141fcf commit c4de479

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/main/java/gregtech/api/metatileentity/multiblock/MultiMapMultiblockController.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import gregtech.api.gui.widgets.ImageCycleButtonWidget;
99
import gregtech.api.pattern.TraceabilityPredicate;
1010
import gregtech.api.recipes.RecipeMap;
11+
import gregtech.api.util.GTUtility;
1112
import gregtech.api.util.LocalizationUtils;
13+
import gregtech.api.util.TextComponentUtil;
1214

1315
import net.minecraft.client.resources.I18n;
1416
import net.minecraft.entity.player.EntityPlayer;
@@ -18,7 +20,9 @@
1820
import net.minecraft.util.EnumFacing;
1921
import net.minecraft.util.EnumHand;
2022
import net.minecraft.util.ResourceLocation;
23+
import net.minecraft.util.text.ITextComponent;
2124
import net.minecraft.util.text.TextComponentTranslation;
25+
import net.minecraft.util.text.TextFormatting;
2226
import net.minecraft.world.World;
2327
import net.minecraftforge.common.capabilities.Capability;
2428
import net.minecraftforge.fml.relauncher.Side;
@@ -68,6 +72,19 @@ public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFaci
6872
return true; // return true here on the client to keep the GUI closed
6973
}
7074

75+
@Override
76+
protected void addDisplayText(List<ITextComponent> textList) {
77+
MultiblockDisplayText.builder(textList, isStructureFormed())
78+
.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive())
79+
.addEnergyUsageLine(recipeMapWorkable.getEnergyContainer())
80+
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage()))
81+
.addParallelsLine(recipeMapWorkable.getParallelLimit())
82+
.addWorkingStatusLine()
83+
.addProgressLine(recipeMapWorkable.getProgressPercent())
84+
.addCustom(tl -> tl.add(TextComponentUtil.translationWithColor(TextFormatting.GRAY,
85+
"gregtech.multiblock.active_machine_mode", getCurrentRecipeMap().getLocalizedName())));
86+
}
87+
7188
@Override
7289
public RecipeMap<?>[] getAvailableRecipeMaps() {
7390
return recipeMaps;

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5817,6 +5817,8 @@ gregtech.multiblock.hpca.info_coolant_name=PCB Coolant
58175817
gregtech.multiblock.hpca.info_bridging_enabled=Bridging Enabled
58185818
gregtech.multiblock.hpca.info_bridging_disabled=Bridging Disabled
58195819

5820+
gregtech.multiblock.active_machine_mode=Active Machine Mode: %s
5821+
58205822
gregtech.command.usage=Usage: /gregtech <worldgen/hand/recipecheck/datafix>
58215823
gregtech.command.worldgen.usage=Usage: /gregtech worldgen <reload>
58225824
gregtech.command.worldgen.reload.usage=Usage: /gregtech worldgen reload

0 commit comments

Comments
 (0)