use of com.massivecraft.factions.FLocation in project WildLoaders by BG-Software-LLC.
the class ClaimsProvider_FactionsUUID method hasClaimAccess.
@Override
public boolean hasClaimAccess(UUID player, Chunk chunk) {
FPlayer fPlayer = FPlayers.getInstance().getById(player.toString());
FLocation fLocation = new FLocation(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
Faction faction = Board.getInstance().getFactionAt(fLocation);
return !faction.isWilderness() && faction.getFPlayers().contains(fPlayer);
}
use of com.massivecraft.factions.FLocation in project SilkSpawners by timbru31.
the class SilkSpawnersPlayerListener method checkIfFactionsPermitsBlockInteractions.
public boolean checkIfFactionsPermitsBlockInteractions(final Player player, final Block block) {
if (plugin.config.getBoolean("factionsSupport", false) && su.isPluginEnabled("Factions")) {
try {
final MPlayer mp = MPlayer.get(player);
final Faction blockFaction = BoardColl.get().getFactionAt(PS.valueOf(block.getLocation()));
if (!blockFaction.isNone() && !mp.isInOwnTerritory()) {
su.sendMessage(player, ChatColor.translateAlternateColorCodes('\u0026', plugin.localization.getString("changingDeniedFactions")));
return false;
}
} catch (@SuppressWarnings("unused") final NoClassDefFoundError e) {
// Try for legacy 1.6 factions, e.g. FactionsUUID
final FPlayers fPlayers = FPlayers.getInstance();
final FPlayer fPlayer = fPlayers.getByPlayer(player);
final Board board = Board.getInstance();
final com.massivecraft.factions.Faction blockFaction = board.getFactionAt(new FLocation(block.getLocation()));
if (!blockFaction.isWilderness() && !fPlayer.isInOwnTerritory()) {
su.sendMessage(player, ChatColor.translateAlternateColorCodes('\u0026', plugin.localization.getString("changingDeniedFactions")));
return false;
}
}
}
return true;
}
Aggregations