diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/stats.java b/src/main/java/com/gamingmesh/jobs/commands/list/stats.java index 5d50d979..a53d70ab 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/stats.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/stats.java @@ -1,7 +1,5 @@ package com.gamingmesh.jobs.commands.list; -import java.util.List; - import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 771a10bb..70191172 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import org.apache.commons.lang.StringEscapeUtils; import org.bukkit.configuration.ConfigurationSection; @@ -947,14 +948,18 @@ public class ConfigManager { return; } - List jobs = new ArrayList<>(); + Map map = new TreeMap<>(); + + for (YmlMaker conf : jobFiles) { Job job = loadJobs(conf.getConfig().getConfigurationSection("")); if (job != null) { - jobs.add(job); + map.put(job.getName(), job); } } - + + List jobs = new ArrayList<>(); + jobs.addAll(map.values()); Jobs.setJobs(jobs); if (!jobs.isEmpty()) {