mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
Merge pull request #496 from barpec12/master
Add possibility to load schems with non-lowercase names.
This commit is contained in:
commit
7b79755d92
@ -3,11 +3,13 @@ package world.bentobox.bentobox.managers;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
import java.util.jar.JarFile;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.jar.JarFile;
|
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
@ -74,7 +76,7 @@ public class SchemsManager {
|
|||||||
* @return map of schems for this world or an empty map if there are none registered
|
* @return map of schems for this world or an empty map if there are none registered
|
||||||
*/
|
*/
|
||||||
public Map<String, Clipboard> get(World world) {
|
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 +109,7 @@ public class SchemsManager {
|
|||||||
|
|
||||||
private boolean loadSchem(World world, File schems, String name) {
|
private boolean loadSchem(World world, File schems, String name) {
|
||||||
plugin.log("Loading " + name + ".schem for " + world.getName());
|
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 {
|
try {
|
||||||
Clipboard cb = new Clipboard(plugin, schems);
|
Clipboard cb = new Clipboard(plugin, schems);
|
||||||
cb.load(name);
|
cb.load(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user