use of com.griefdefender.api.User in project GDHooks by bloodmc.
the class GDHooks method generateClaimIdTabList.
private Set<String> generateClaimIdTabList(Player player) {
final Set<String> tabList = new HashSet<>();
final User user = GriefDefender.getCore().getUser(player.getUniqueId());
if (user.getPlayerData().canManageAdminClaims()) {
final Map<String, UUID> adminMap = GriefDefender.getCore().getFriendlyIdentifierMapView().get(GriefDefender.getCore().getAdminUser().getUniqueId());
if (adminMap != null) {
for (String key : adminMap.keySet()) {
tabList.add("admin:" + key);
}
}
}
if (user.getPlayerData().canManageWildernessClaims()) {
final Map<String, UUID> worldMap = GriefDefender.getCore().getFriendlyIdentifierMapView().get(GriefDefender.getCore().getWildernessUser().getUniqueId());
if (worldMap != null) {
for (String key : worldMap.keySet()) {
tabList.add("wilderness:" + key);
}
}
}
final Map<String, UUID> playerMap = GriefDefender.getCore().getFriendlyIdentifierMapView().get(player.getUniqueId());
if (playerMap != null) {
for (String key : playerMap.keySet()) {
tabList.add(key);
}
}
return tabList;
}
use of com.griefdefender.api.User in project CombatLogX by SirBlobman.
the class GriefDefenderRegionHandler method isSafeZone.
@Override
public boolean isSafeZone(Player player, Location location, TagType tagType) {
if (tagType != TagType.PLAYER) {
return false;
}
Claim claim = getClaimAt(location);
if (claim == null) {
return false;
}
UUID playerId = player.getUniqueId();
Core core = GriefDefender.getCore();
User user = core.getUser(playerId);
Set<Context> contexts = new HashSet<>();
TypeToken<Tristate> typeTokenTristate = TypeToken.get(Tristate.class);
Tristate activeOptionValue = claim.getActiveOptionValue(typeTokenTristate, Options.PVP, user, contexts);
return (activeOptionValue != Tristate.TRUE);
}