From 1e73986c60e8d943c76e22e91e14d0b73e498b08 Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 16 May 2018 19:03:32 +0100 Subject: [PATCH] Allow world rewrite options to apply in (some) Vault lookups (#990) --- .../me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java index 66fdbd36..344a1a4f 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java @@ -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