Multiverse / Multiverse-Core

The original Bukkit Multi-World Plugin!
BSD 3-Clause "New" or "Revised" License
924 stars 295 forks source link

Feature request: Order mv list output alphabetically #1960

Open SlimeDog opened 5 years ago

SlimeDog commented 5 years ago

Spigot 1.13.2 MV-Core 2.7.0-SNAPSHOT-b747

>mv list
[22:58:17 INFO]: ====[ Multiverse World List ]====
[22:58:17 INFO]: minigames - NORMAL
[22:58:17 INFO]: yellowdog - NORMAL
[22:58:17 INFO]: skyblock-the-end - THE_END
[22:58:17 INFO]: void - NORMAL
[22:58:17 INFO]: skyblock-nether - NETHER
[22:58:17 INFO]: luckyblock - NORMAL
[22:58:17 INFO]: parkour - NORMAL
[22:58:17 INFO]: skyblock - NORMAL
[22:58:17 INFO]: playground-the-end - THE_END
[22:58:17 INFO]: playground - NORMAL
[22:58:17 INFO]: playground-nether - NETHER
[22:58:17 INFO]: yellowdog-nether - NETHER
[22:58:17 INFO]: lobby - NORMAL
[22:58:17 INFO]: city - NORMAL
[22:58:17 INFO]: city-nether - NETHER

would be more user-friendly if it were

>mv list
[22:58:17 INFO]: ====[ Multiverse World List ]====
[22:58:17 INFO]: city - NORMAL
[22:58:17 INFO]: city-nether - NETHER
[22:58:17 INFO]: lobby - NORMAL
[22:58:17 INFO]: luckyblock - NORMAL
[22:58:17 INFO]: minigames - NORMAL 
[22:58:17 INFO]: parkour - NORMAL
[22:58:17 INFO]: playground - NORMAL
[22:58:17 INFO]: playground-nether - NETHER
[22:58:17 INFO]: playground-the-end - THE_END
[22:58:17 INFO]: skyblock - NORMAL
[22:58:17 INFO]: skyblock-nether - NETHER
[22:58:17 INFO]: skyblock-the-end - THE_END
[22:58:17 INFO]: void - NORMAL
[22:58:17 INFO]: yellowdog - NORMAL
[22:58:17 INFO]: yellowdog-nether - NETHER
dumptruckman commented 5 years ago

This is a neat idea. However, what if someone would prefer some kind of logical grouping? For instance, if they had a group of survival worlds and a group of creative worlds. I imagine they would prefer those to show up together. As such, I have some ideas for tackling this and providing a way to satisfy both desires.

SlimeDog commented 5 years ago

A variety of useful sorting schemes would be great. Alphabetical just makes them easier to find in the list (I have 23 worlds), and I would think the easiest to implement. Grouping is a whole other kettle of fish.

VL4DST3R commented 4 years ago

What is the current reasoning behind how worlds get sorted? It is so annoying having them mixed at random, even if you import them in a specific order. Even more so, if you try and edit the worlds.yml file to manually sort them, they reset back to the "random" order.

SlimeDog commented 4 years ago

Since it's been raised again, count again my voice for alphanumeric sorting.

timriker commented 4 years ago

Another vote for alpha sort. This should include /mv list as well as the api for plugins like dynmap so that worlds are sorted there as well.

VL4DST3R commented 4 years ago

Ah yes, dynmap is also affected by this. Iirc you can fix it on the dynmap side by manually rearranging the generated web files, but again, still a pain. Please add alphabetical sort!

timriker commented 4 years ago

It might be as easy as adding a sort(compareByAlias) to getMVWorlds() with something like:

Collection<MultiverseWorld> compareByAlias = new Comparator<MultiverseWorld>() {
    @Override
    public int compare(MultiverseWorlds a, MultiverseWorld b) {
        return a.getAlias().compareTo(b.getAlias());
    }
};