Minor improvement of the comparator in /bbox version

This commit is contained in:
Florian CUNY 2019-04-17 21:53:32 +02:00
parent 197d51add0
commit 82dccfd839

View File

@ -1,12 +1,14 @@
package world.bentobox.bentobox.commands;
import java.util.List;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.versions.ServerCompatibility;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/**
* Displays information about Gamemodes, Addons and versioning.
*
@ -38,11 +40,11 @@ public class BentoBoxVersionCommand extends CompositeCommand {
user.sendMessage("commands.bentobox.version.plugin-version", TextVariables.VERSION, getPlugin().getDescription().getVersion());
user.sendMessage("commands.bentobox.version.loaded-game-worlds");
getIWM().getOverWorldNames().entrySet().stream().sorted((o1, o2)-> o1.getKey().compareTo(o2.getKey()))
getIWM().getOverWorldNames().entrySet().stream().sorted(Comparator.comparing(Map.Entry::getKey))
.forEach(e -> user.sendMessage("commands.bentobox.version.game-worlds", TextVariables.NAME, e.getKey(), "[addon]", e.getValue()));
user.sendMessage("commands.bentobox.version.loaded-addons");
getPlugin().getAddonsManager().getAddons().stream().sorted((o1, o2)->o1.getDescription().getName().toLowerCase().compareTo(o2.getDescription().getName().toLowerCase()))
getPlugin().getAddonsManager().getAddons().stream().sorted(Comparator.comparing(o -> o.getDescription().getName().toLowerCase()))
.forEach(a -> user.sendMessage("commands.bentobox.version.addon-syntax", TextVariables.NAME, a.getDescription().getName(),
TextVariables.VERSION, a.getDescription().getVersion()));