mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 21:27:44 +01:00
Add possibility to load schems with non-lowercase names.
This commit is contained in:
parent
8cddb1e69f
commit
c6b4a10634
@ -3,10 +3,7 @@ package world.bentobox.bentobox.managers;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import org.bukkit.World;
|
||||
@ -74,7 +71,7 @@ public class SchemsManager {
|
||||
* @return map of schems for this world or an empty map if there are none registered
|
||||
*/
|
||||
public Map<String, Clipboard> get(World world) {
|
||||
return islandSchems.getOrDefault(world, new HashMap<>());
|
||||
return islandSchems.getOrDefault(world, new TreeMap<>(String.CASE_INSENSITIVE_ORDER));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,7 +104,7 @@ public class SchemsManager {
|
||||
|
||||
private boolean loadSchem(World world, File schems, String name) {
|
||||
plugin.log("Loading " + name + ".schem for " + world.getName());
|
||||
Map<String, Clipboard> schemList = islandSchems.getOrDefault(world, new HashMap<>());
|
||||
Map<String, Clipboard> schemList = islandSchems.getOrDefault(world, new TreeMap<>(String.CASE_INSENSITIVE_ORDER));
|
||||
try {
|
||||
Clipboard cb = new Clipboard(plugin, schems);
|
||||
cb.load(name);
|
||||
|
Loading…
Reference in New Issue
Block a user