mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Run residence permission playerHas check on main thread
This commit is contained in:
parent
275ba9bd84
commit
e6b18cf230
@ -5,6 +5,7 @@ import com.bekvon.bukkit.residence.protection.ClaimedResidence;
|
|||||||
import com.bekvon.bukkit.residence.protection.CuboidArea;
|
import com.bekvon.bukkit.residence.protection.CuboidArea;
|
||||||
import com.fastasyncworldedit.bukkit.FaweBukkit;
|
import com.fastasyncworldedit.bukkit.FaweBukkit;
|
||||||
import com.fastasyncworldedit.core.regions.FaweMask;
|
import com.fastasyncworldedit.core.regions.FaweMask;
|
||||||
|
import com.fastasyncworldedit.core.util.TaskManager;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
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) {
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user