Maybe fix an issue with per-server prefixes/suffixes

This commit is contained in:
Luck 2016-09-11 14:34:38 +01:00
parent 9df39a9545
commit 116094ea96
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -118,11 +118,9 @@ public class VaultChatHook extends Chat {
continue; continue;
} }
if (!perms.getServer().equalsIgnoreCase("global")) {
if (!n.shouldApplyOnServer(perms.getServer(), perms.isIncludeGlobal(), false)) { if (!n.shouldApplyOnServer(perms.getServer(), perms.isIncludeGlobal(), false)) {
continue; continue;
} }
}
if (!n.shouldApplyOnWorld(world, perms.isIncludeGlobal(), false)) { if (!n.shouldApplyOnWorld(world, perms.isIncludeGlobal(), false)) {
continue; continue;
@ -169,20 +167,18 @@ public class VaultChatHook extends Chat {
continue; continue;
} }
if (!perms.getServer().equalsIgnoreCase("global")) { if (prefix ? !n.isPrefix() : !n.isSuffix()) {
continue;
}
if (!n.shouldApplyOnServer(perms.getServer(), perms.isIncludeGlobal(), false)) { if (!n.shouldApplyOnServer(perms.getServer(), perms.isIncludeGlobal(), false)) {
continue; continue;
} }
}
if (!n.shouldApplyOnWorld(world, perms.isIncludeGlobal(), false)) { if (!n.shouldApplyOnWorld(world, perms.isIncludeGlobal(), false)) {
continue; continue;
} }
if (prefix ? !n.isPrefix() : !n.isSuffix()) {
continue;
}
Map.Entry<Integer, String> value = prefix ? n.getPrefix() : n.getSuffix(); Map.Entry<Integer, String> value = prefix ? n.getPrefix() : n.getSuffix();
if (value.getKey() > priority) { if (value.getKey() > priority) {
meta = value.getValue(); meta = value.getValue();