From eab24f89fee7ba414bd390fe8f364458120ff27b Mon Sep 17 00:00:00 2001 From: Siroshun09 Date: Tue, 16 Apr 2024 01:42:24 +0900 Subject: [PATCH] fix(craft): don't show ingredient list when the ingredient pattern is single --- .../craft/gui/button/IngredientButton.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/features/craft/src/main/java/net/okocraft/box/feature/craft/gui/button/IngredientButton.java b/features/craft/src/main/java/net/okocraft/box/feature/craft/gui/button/IngredientButton.java index 4da17aaaa2..80220d835d 100644 --- a/features/craft/src/main/java/net/okocraft/box/feature/craft/gui/button/IngredientButton.java +++ b/features/craft/src/main/java/net/okocraft/box/feature/craft/gui/button/IngredientButton.java @@ -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())) {