Skip to content

Commit

Permalink
fix(craft): don't show ingredient list when the ingredient pattern is…
Browse files Browse the repository at this point in the history
… single
  • Loading branch information
Siroshun09 committed Apr 15, 2024
1 parent b118ef1 commit eab24f8
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ public int getSlot() {

var editor = ItemEditor.create();

for (var ingredient : ingredients.get()) {
editor.loreLine(
Component.text()
.append(Component.text(" > "))
.append(Component.translatable(ingredient.item().getOriginal()))
.append(Component.space())
.append(Component.text("(" + session.getSourceStockHolder().getAmount(ingredient.item()) + ")"))
.style(ingredient == ingredients.getSelected() ? Styles.NO_DECORATION_AQUA : Styles.NO_DECORATION_GRAY)
.build()
);
if (ingredients.size() != 1) {
for (var ingredient : ingredients.get()) {
editor.loreLine(
Component.text()
.append(Component.text(" > "))
.append(Component.translatable(ingredient.item().getOriginal()))
.append(Component.space())
.append(Component.text("(" + session.getSourceStockHolder().getAmount(ingredient.item()) + ")"))
.style(ingredient == ingredients.getSelected() ? Styles.NO_DECORATION_AQUA : Styles.NO_DECORATION_GRAY)
.build()
);
}
}

if (RecipeRegistry.hasRecipe(ingredients.getSelected().item())) {
Expand Down

0 comments on commit eab24f8

Please sign in to comment.