diff --git a/src/main/java/net/knarcraft/paidsigns/command/ListCommand.java b/src/main/java/net/knarcraft/paidsigns/command/ListCommand.java index 0fdef4e..56b08ec 100644 --- a/src/main/java/net/knarcraft/paidsigns/command/ListCommand.java +++ b/src/main/java/net/knarcraft/paidsigns/command/ListCommand.java @@ -10,7 +10,11 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.Set; import static net.knarcraft.paidsigns.formatting.StringFormatter.getTranslatedErrorMessage; import static net.knarcraft.paidsigns.formatting.StringFormatter.replacePlaceholder; @@ -42,7 +46,11 @@ public class ListCommand extends TokenizedCommand { */ private void displaySigns(CommandSender sender) { StringBuilder signs = new StringBuilder(); - for (String signName : PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet()) { + Set signNames = PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet(); + List signNameList = new ArrayList<>(signNames); + Collections.sort(signNameList); + + for (String signName : signNameList) { signs.append(StringFormatter.replacePlaceholder(Translator.getTranslatedMessage( TranslatableMessage.PAID_SIGNS_INFO_FORMAT), "{name}", signName)); }