diff --git a/src/main/java/satisfactory/items/Recipe.java b/src/main/java/satisfactory/items/Recipe.java index 06d26af..c1e5a42 100644 --- a/src/main/java/satisfactory/items/Recipe.java +++ b/src/main/java/satisfactory/items/Recipe.java @@ -247,8 +247,14 @@ public class Recipe { public String getName() { return name; } + public String formatName(){ + if (name == null) { + return formatOutputs(); + } + return name + " (" + formatOutputs() + ")"; + } - public String getOutputs() { + public String formatOutputs() { return outputs.keySet().stream().map(Item::getName).collect(Collectors.joining(" + ")); } } diff --git a/src/main/java/satisfactory/items/SumResult.java b/src/main/java/satisfactory/items/SumResult.java index 46b0005..53021eb 100644 --- a/src/main/java/satisfactory/items/SumResult.java +++ b/src/main/java/satisfactory/items/SumResult.java @@ -102,9 +102,9 @@ public class SumResult { StringBuilder internal = new StringBuilder(); for (Map.Entry recipes : entry.getValue().entrySet()) { sum += Math.ceil(recipes.getValue()); - internal.append("\t").append(recipes.getKey().getName()).append(" (").append(recipes.getKey().getOutputs()).append(")\t").append(recipes.getValue()).append("\n"); + internal.append("\t").append(recipes.getKey().formatName()).append("\t").append(recipes.getValue()).append("\n"); } - sb.append(entry.getKey().getName().replace("satisfactory.buildings.production.","")). append("\t"). append(sum).append("\n").append(internal); + sb.append(entry.getKey().getName()). append("\t"). append(sum).append("\n").append(internal); } return sb.toString(); }