Make sure world names are lowercase'd

This commit is contained in:
Luck 2017-04-08 17:00:36 +01:00
parent 9de44d2605
commit 82e759d708
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
4 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,7 @@ public class WorldCalculator implements ContextCalculator<Player> {
world = plugin.getConfiguration().get(ConfigKeys.WORLD_REWRITES).getOrDefault(world, world); world = plugin.getConfiguration().get(ConfigKeys.WORLD_REWRITES).getOrDefault(world, world);
if (world != null) { if (world != null) {
accumulator.add(Maps.immutableEntry(WORLD_KEY, world)); accumulator.add(Maps.immutableEntry(WORLD_KEY, world.toLowerCase()));
} }
return accumulator; return accumulator;

View File

@ -41,7 +41,7 @@ public class BackendServerCalculator implements ContextCalculator<ProxiedPlayer>
String server = getServer(subject); String server = getServer(subject);
if (server != null) { if (server != null) {
accumulator.add(Maps.immutableEntry(WORLD_KEY, server)); accumulator.add(Maps.immutableEntry(WORLD_KEY, server.toLowerCase()));
} }
return accumulator; return accumulator;

View File

@ -54,7 +54,8 @@ public class ContextManager<T> {
} }
public void registerCalculator(ContextCalculator<T> calculator) { public void registerCalculator(ContextCalculator<T> calculator) {
calculators.add(calculator); // calculators registered first should have priority (and be checked last.)
calculators.add(0, calculator);
} }
public int getCalculatorsSize() { public int getCalculatorsSize() {

View File

@ -43,7 +43,7 @@ public class WorldCalculator implements ContextCalculator<Subject> {
} }
Player p = ((Player) source); Player p = ((Player) source);
accumulator.add(Context.WORLD_KEY, p.getWorld().getName()); accumulator.add(Context.WORLD_KEY, p.getWorld().getName().toLowerCase());
return accumulator; return accumulator;
} }