Allow world rewrite options to apply in (some) Vault lookups (#990)

This commit is contained in:
Luck 2018-05-16 19:03:32 +01:00
parent 20f992110d
commit 1e73986c60
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -345,9 +345,11 @@ public class VaultPermissionHook extends AbstractVaultPermission {
context = this.plugin.getContextManager().getStaticContext().mutableCopy();
}
String playerWorld = player == null ? null : player.getWorld().getName();
// if world is null, we want to do a lookup in the players current context
// if world is not null, we want to do a lookup in that specific world
if (world != null && !world.isEmpty()) {
if (world != null && !world.isEmpty() && !world.equalsIgnoreCase(playerWorld)) {
// remove already accumulated worlds
context.removeAll(Contexts.WORLD_KEY);
// add the vault world