From e6b18cf2307393275338eea286cb846b7ba11020 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 18 Jul 2021 13:18:55 +0100 Subject: [PATCH] Run residence permission playerHas check on main thread --- .../fastasyncworldedit/bukkit/regions/ResidenceFeature.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java index e8420ffde..6d9190d52 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/ResidenceFeature.java @@ -5,6 +5,7 @@ import com.bekvon.bukkit.residence.protection.ClaimedResidence; import com.bekvon.bukkit.residence.protection.CuboidArea; import com.fastasyncworldedit.bukkit.FaweBukkit; import com.fastasyncworldedit.core.regions.FaweMask; +import com.fastasyncworldedit.core.util.TaskManager; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.internal.util.LogManagerCompat; import com.sk89q.worldedit.regions.CuboidRegion; @@ -29,7 +30,10 @@ public class ResidenceFeature extends BukkitMaskManager implements Listener { } public boolean isAllowed(Player player, ClaimedResidence residence, MaskType type) { - return residence != null && (residence.getOwner().equals(player.getName()) || residence.getOwner().equals(player.getUniqueId().toString()) || type == MaskType.MEMBER && residence.getPermissions().playerHas(player, "build", false)); + return residence != null && + (residence.getOwner().equals(player.getName()) || + residence.getOwner().equals(player.getUniqueId().toString()) || + type == MaskType.MEMBER && TaskManager.IMP.sync(() -> residence.getPermissions().playerHas(player, "build", false))); } @Override