diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java index 3a3f2c7..22f3bb7 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditChallengeGUI.java @@ -881,7 +881,16 @@ public class EditChallengeGUI extends CommonGUI new StringListGUI(this.user, this.challenge.getRewardText(), lineLength, (status, value) -> { if (status) { - this.challenge.setRewardText(value.stream().map(s -> s + "|").collect(Collectors.joining())); + String singleLineMessage = value.stream(). + map(s -> s + "|"). + collect(Collectors.joining()); + + if (singleLineMessage.endsWith("|")) + { + singleLineMessage = singleLineMessage.substring(0, singleLineMessage.length() - 1); + } + + this.challenge.setRewardText(singleLineMessage); } this.build(); @@ -1055,7 +1064,16 @@ public class EditChallengeGUI extends CommonGUI new StringListGUI(this.user, this.challenge.getRepeatRewardText(), lineLength, (status, value) -> { if (status) { - this.challenge.setRepeatRewardText(value.stream().map(s -> s + "|").collect(Collectors.joining())); + String singleLineMessage = value.stream(). + map(s -> s + "|"). + collect(Collectors.joining()); + + if (singleLineMessage.endsWith("|")) + { + singleLineMessage = singleLineMessage.substring(0, singleLineMessage.length() - 1); + } + + this.challenge.setRepeatRewardText(singleLineMessage); } this.build(); diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java index fdc5eee..db7a81f 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditLevelGUI.java @@ -415,7 +415,16 @@ public class EditLevelGUI extends CommonGUI new StringListGUI(this.user, this.challengeLevel.getUnlockMessage(), lineLength, (status, value) -> { if (status) { - this.challengeLevel.setUnlockMessage(value.stream().map(s -> s + "|").collect(Collectors.joining())); + String singleLineMessage = value.stream(). + map(s -> s + "|"). + collect(Collectors.joining()); + + if (singleLineMessage.endsWith("|")) + { + singleLineMessage = singleLineMessage.substring(0, singleLineMessage.length() - 1); + } + + this.challengeLevel.setUnlockMessage(singleLineMessage); } this.build(); @@ -486,7 +495,16 @@ public class EditLevelGUI extends CommonGUI new StringListGUI(this.user, this.challengeLevel.getRewardText(), lineLength, (status, value) -> { if (status) { - this.challengeLevel.setRewardText(value.stream().map(s -> s + "|").collect(Collectors.joining())); + String singleLineMessage = value.stream(). + map(s -> s + "|"). + collect(Collectors.joining()); + + if (singleLineMessage.endsWith("|")) + { + singleLineMessage = singleLineMessage.substring(0, singleLineMessage.length() - 1); + } + + this.challengeLevel.setRewardText(singleLineMessage); } this.build();