mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Sorting jobs alphabetically, mainly for GUI purposes
This commit is contained in:
parent
ab07c80b62
commit
4341e2a333
@ -1,7 +1,5 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
@ -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<Job> jobs = new ArrayList<>();
|
||||
Map<String, Job> 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<Job> jobs = new ArrayList<>();
|
||||
jobs.addAll(map.values());
|
||||
Jobs.setJobs(jobs);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user