From 68a26e4d280e790a3beab676325bca59777a4f2f Mon Sep 17 00:00:00 2001 From: BONNe Date: Sun, 16 Jun 2019 15:59:41 +0300 Subject: [PATCH] Fix unstackable reward item displaying (#135) --- .../java/world/bentobox/challenges/panel/CommonGUI.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java index e9870b9..06a457e 100644 --- a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java @@ -545,7 +545,7 @@ public abstract class CommonGUI { result.add(this.user.getTranslation("challenges.gui.challenge-description.reward-items")); - for (ItemStack itemStack : rewardItems) + Utils.groupEqualItems(rewardItems).forEach(itemStack -> { result.add(this.user.getTranslation("challenges.gui.descriptions.item", "[item]", itemStack.getType().name(), @@ -562,7 +562,7 @@ public abstract class CommonGUI result.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); } - } + }); } // Add message about reward commands @@ -778,7 +778,7 @@ public abstract class CommonGUI { result.add(this.user.getTranslation("challenges.gui.level-description.reward-items")); - for (ItemStack itemStack : level.getRewardItems()) + Utils.groupEqualItems(level.getRewardItems()).forEach(itemStack -> { result.add(this.user.getTranslation("challenges.gui.descriptions.item", "[item]", itemStack.getType().name(), @@ -795,7 +795,7 @@ public abstract class CommonGUI result.add(this.user.getTranslation("challenges.gui.descriptions.item-enchant", "[enchant]", entry.getKey().getKey().getKey(), "[level]", Integer.toString(entry.getValue()))); } - } + }); } // Add message about reward commands