Skip to content

Commit 0f42277

Browse files
committed
#2671 but mui2
1 parent 85f59d4 commit 0f42277

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import gregtech.api.mui.GTGuiTextures;
88
import gregtech.api.pattern.TraceabilityPredicate;
99
import gregtech.api.recipes.RecipeMap;
10+
import gregtech.api.util.GTUtility;
1011

1112
import net.minecraft.client.resources.I18n;
1213
import net.minecraft.entity.player.EntityPlayer;
@@ -156,6 +157,17 @@ protected MultiblockUIFactory createUIFactory() {
156157
});
157158
}
158159

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

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock;
1010
import gregtech.api.mui.GTGuiTextures;
1111
import gregtech.api.mui.GTGuis;
12+
import gregtech.api.recipes.RecipeMap;
1213
import gregtech.api.util.GTLog;
1314
import gregtech.api.util.JsonUtils;
1415
import gregtech.api.util.KeyUtil;
@@ -809,6 +810,19 @@ public Builder addFuelNeededLine(String fuelName, int previousRecipeDuration) {
809810
return this;
810811
}
811812

813+
/**
814+
* Adds the name of the current recipe map to the display.
815+
* @param map the {@link RecipeMap} to get the name of
816+
*/
817+
public Builder addRecipeMapLine(RecipeMap<?> map) {
818+
if (!isStructureFormed) return this;
819+
820+
IKey mapName = KeyUtil.lang(TextFormatting.YELLOW, map.getTranslationKey());
821+
addKey(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.machine_mode", mapName));
822+
823+
return this;
824+
}
825+
812826
/** Insert an empty line into the text list. */
813827
public Builder addEmptyLine() {
814828
this.textList.add(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
@@ -5909,6 +5909,8 @@ gregtech.multiblock.hpca.info_coolant_name=PCB Coolant
59095909
gregtech.multiblock.hpca.info_bridging_enabled=Bridging Enabled
59105910
gregtech.multiblock.hpca.info_bridging_disabled=Bridging Disabled
59115911

5912+
gregtech.multiblock.machine_mode=Machine Mode: %s
5913+
59125914
gregtech.command.usage=Usage: /gregtech <worldgen/hand/recipecheck/datafix>
59135915
gregtech.command.worldgen.usage=Usage: /gregtech worldgen <reload>
59145916
gregtech.command.worldgen.reload.usage=Usage: /gregtech worldgen reload

0 commit comments

Comments
 (0)