Run residence permission playerHas check on main thread

Dieser Commit ist enthalten in:
dordsor21 2021-07-18 13:18:55 +01:00
Ursprung 275ba9bd84
Commit e6b18cf230
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -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