cleanup
This commit is contained in:
parent
23f757e916
commit
02ff4a4acb
@ -46,7 +46,7 @@ class BukkitListener extends AbstractListener implements Listener {
|
|||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void onPlayerPreLogin(AsyncPlayerPreLoginEvent e) {
|
public void onPlayerPreLogin(AsyncPlayerPreLoginEvent e) {
|
||||||
if (!plugin.isStarted() || !plugin.getStorage().isAcceptingLogins()) {
|
if (!plugin.isStarted() || !plugin.getStorage().isAcceptingLogins()) {
|
||||||
|
@ -290,21 +290,21 @@ public class ImmutableNode implements Node {
|
|||||||
return isWorldSpecific() ? shouldApply(world, applyRegex, this.world) : includeGlobal;
|
return isWorldSpecific() ? shouldApply(world, applyRegex, this.world) : includeGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean shouldApply(String world, boolean applyRegex, String thisWorld) {
|
private static boolean shouldApply(String str, boolean applyRegex, String thisStr) {
|
||||||
if (world.toLowerCase().startsWith("r=") && applyRegex) {
|
if (str.toLowerCase().startsWith("r=") && applyRegex) {
|
||||||
Pattern p = Patterns.compile(world.substring(2));
|
Pattern p = Patterns.compile(str.substring(2));
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return p.matcher(thisWorld).matches();
|
return p.matcher(thisStr).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.startsWith("(") && world.endsWith(")") && world.contains("|")) {
|
if (str.startsWith("(") && str.endsWith(")") && str.contains("|")) {
|
||||||
final String bits = world.substring(1, world.length() - 1);
|
final String bits = str.substring(1, str.length() - 1);
|
||||||
Iterable<String> parts = Splitter.on('|').split(bits);
|
Iterable<String> parts = Splitter.on('|').split(bits);
|
||||||
|
|
||||||
for (String s : parts) {
|
for (String s : parts) {
|
||||||
if (s.equalsIgnoreCase(thisWorld)) {
|
if (s.equalsIgnoreCase(thisStr)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ public class ImmutableNode implements Node {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return thisWorld.equalsIgnoreCase(world);
|
return thisStr.equalsIgnoreCase(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user