Search in sources :

Example 1 with ResidencePermissions

use of com.bekvon.bukkit.residence.protection.ResidencePermissions in project CombatLogX by SirBlobman.

the class ResidenceRegionHandler method isSafeZone.

@Override
public boolean isSafeZone(Player player, Location location, TagType tagType) {
    if (tagType != TagType.PLAYER)
        return false;
    ResidenceInterface residenceManager = ResidenceApi.getResidenceManager();
    ClaimedResidence claimedResidence = residenceManager.getByLoc(location);
    if (claimedResidence == null)
        return false;
    ResidencePermissions residencePermissions = claimedResidence.getPermissions();
    return !residencePermissions.has(Flags.pvp, true);
}
Also used : ClaimedResidence(com.bekvon.bukkit.residence.protection.ClaimedResidence) ResidencePermissions(com.bekvon.bukkit.residence.protection.ResidencePermissions) ResidenceInterface(com.bekvon.bukkit.residence.api.ResidenceInterface)

Example 2 with ResidencePermissions

use of com.bekvon.bukkit.residence.protection.ResidencePermissions in project Skript by SkriptLang.

the class ResidenceHook method canBuild_i.

@Override
public boolean canBuild_i(final Player p, final Location l) {
    final ClaimedResidence res = Residence.getInstance().getResidenceManager().getByLoc(l);
    if (res == null)
        // No claim here
        return true;
    ResidencePermissions perms = res.getPermissions();
    return perms.playerHas(p, Flags.build, true);
}
Also used : ClaimedResidence(com.bekvon.bukkit.residence.protection.ClaimedResidence) ResidencePermissions(com.bekvon.bukkit.residence.protection.ResidencePermissions)

Aggregations

ClaimedResidence (com.bekvon.bukkit.residence.protection.ClaimedResidence)2 ResidencePermissions (com.bekvon.bukkit.residence.protection.ResidencePermissions)2 ResidenceInterface (com.bekvon.bukkit.residence.api.ResidenceInterface)1