Skip to content

Commit 8f64246

Browse files
committed
Dedicated method for formatting the line and use IKey.SPACE
1 parent f264a29 commit 8f64246

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ public Builder addItemOutputLine(@NotNull List<ItemStack> itemOutputs, int recip
884884
IKey itemName = KeyUtil.string(TextFormatting.AQUA, entry.getKey());
885885
IKey itemAmount = KeyUtil.number(TextFormatting.GOLD, entry.getValue());
886886
IKey itemRate = KeyUtil.string(TextFormatting.WHITE, formatRecipeRate(recipeLength, entry.getValue()));
887-
addKey(IKey.comp(itemName, KeyUtil.string(TextFormatting.WHITE, " x "), itemAmount, IKey.str(" "), itemRate));
887+
addKey(formatRecipeData(itemName, itemAmount, itemRate));
888888
}
889889

890890
return this;
@@ -911,7 +911,7 @@ public Builder addFluidOutputLine(@NotNull List<FluidStack> fluidOutputs, int re
911911
IKey fluidName = KeyUtil.fluid(TextFormatting.AQUA, entry.getKey());
912912
IKey fluidAmount = KeyUtil.number(TextFormatting.GOLD, entry.getValue());
913913
IKey fluidRate = KeyUtil.string(TextFormatting.WHITE, formatRecipeRate(recipeLength, entry.getValue()));
914-
addKey(IKey.comp(fluidName, KeyUtil.string(TextFormatting.WHITE, " x "), fluidAmount, IKey.str(" "), fluidRate));
914+
addKey(formatRecipeData(fluidName, fluidAmount, fluidRate));
915915
}
916916

917917
return this;
@@ -930,6 +930,10 @@ private static String formatRecipeRate(int recipeLength, long amount) {
930930
return rate;
931931
}
932932

933+
private static IKey formatRecipeData(IKey name, IKey amount, IKey rate) {
934+
return IKey.comp(name, KeyUtil.string(TextFormatting.WHITE, " x "), amount, IKey.SPACE, rate);
935+
}
936+
933937
/** Insert an empty line into the text list. */
934938
public Builder addEmptyLine() {
935939
this.textList.add(IKey.LINE_FEED);

0 commit comments

Comments
 (0)