Skip to content

Commit 2807874

Browse files
Zorbatronghzdude
authored andcommitted
Add machine mode to the GUI of MultiMapControllers - MUI2 (#2713)
1 parent 55f010f commit 2807874

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import gregtech.api.capability.GregtechDataCodes;
44
import gregtech.api.capability.GregtechTileCapabilities;
55
import gregtech.api.capability.IMultipleRecipeMaps;
6+
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder;
67
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory;
78
import gregtech.api.mui.GTGuiTextures;
89
import gregtech.api.pattern.TraceabilityPredicate;
910
import gregtech.api.recipes.RecipeMap;
11+
import gregtech.api.util.GTUtility;
1012

1113
import net.minecraft.client.resources.I18n;
1214
import net.minecraft.entity.player.EntityPlayer;
@@ -156,6 +158,17 @@ protected MultiblockUIFactory createUIFactory() {
156158
});
157159
}
158160

161+
@Override
162+
protected void configureDisplayText(MultiblockUIBuilder builder) {
163+
builder.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive())
164+
.addRecipeMapLine(getCurrentRecipeMap())
165+
.addEnergyUsageLine(this.getEnergyContainer())
166+
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage()))
167+
.addParallelsLine(recipeMapWorkable.getParallelLimit())
168+
.addWorkingStatusLine()
169+
.addProgressLine(recipeMapWorkable.getProgressPercent());
170+
}
171+
159172
@Override
160173
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
161174
super.addInformation(stack, player, tooltip, advanced);

src/main/java/gregtech/api/metatileentity/multiblock/ui/MultiblockUIBuilder.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import gregtech.api.GTValues;
44
import gregtech.api.capability.IEnergyContainer;
5+
import gregtech.api.recipes.RecipeMap;
56
import gregtech.api.util.KeyUtil;
67
import gregtech.api.util.TextFormattingUtil;
78
import gregtech.common.ConfigHolder;
@@ -466,6 +467,20 @@ public MultiblockUIBuilder addFuelNeededLine(String fuelName, int previousRecipe
466467
return this;
467468
}
468469

470+
/**
471+
* Adds the name of a recipe map to the display.
472+
*
473+
* @param map the {@link RecipeMap} to get the name of
474+
*/
475+
public MultiblockUIBuilder addRecipeMapLine(RecipeMap<?> map) {
476+
if (!isStructureFormed) return this;
477+
478+
IKey mapName = KeyUtil.lang(TextFormatting.YELLOW, map.getTranslationKey());
479+
addKey(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.machine_mode", mapName));
480+
481+
return this;
482+
}
483+
469484
/** Insert an empty line into the text list. */
470485
public MultiblockUIBuilder addEmptyLine() {
471486
addKey(IKey.LINE_FEED);

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

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

5915+
gregtech.multiblock.machine_mode=Machine Mode: %s
5916+
59155917
gregtech.command.usage=Usage: /gregtech <worldgen/hand/recipecheck/datafix>
59165918
gregtech.command.worldgen.usage=Usage: /gregtech worldgen <reload>
59175919
gregtech.command.worldgen.reload.usage=Usage: /gregtech worldgen reload

0 commit comments

Comments
 (0)