use of com.massivecraft.factions.entity.Faction in project WildLoaders by BG-Software-LLC.
the class ClaimsProvider_MassiveFactions method hasClaimAccess.
@Override
public boolean hasClaimAccess(UUID player, Chunk chunk) {
MPlayer mPlayer = MPlayer.get(player);
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(chunk));
return !faction.getId().equals(Factions.ID_NONE) && faction.getMPlayers().contains(mPlayer);
}
use of com.massivecraft.factions.entity.Faction 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;
}
use of com.massivecraft.factions.entity.Faction in project Depenizen by DenizenScript.
the class FactionsBridge method tagEvent.
public void tagEvent(ReplaceableTagEvent event) {
Attribute attribute = event.getAttributes().fulfill(1);
// -->
if (attribute.startsWith("list_factions")) {
ListTag factions = new ListTag();
for (Faction f : FactionColl.get().getAll()) {
factions.addObject(new FactionTag(f));
}
event.setReplacedObject(factions.getObjectAttribute(attribute.fulfill(1)));
}
}
use of com.massivecraft.factions.entity.Faction in project Conquer by xXAndrew28Xx.
the class MSClaim method setTo.
@Override
public void setTo(ClaimType type) {
Faction faction;
switch(type) {
case WILDERNESS:
faction = factionColl.getNone();
break;
case SAFE_ZONE:
faction = factionColl.getSafezone();
break;
case WAR_ZONE:
faction = factionColl.getWarzone();
break;
default:
return;
}
boardColl.setFactionAt(ps, faction);
}
use of com.massivecraft.factions.entity.Faction in project Sentinel by mcmonkey4eva.
the class SentinelFactions method isTarget.
@Override
public boolean isTarget(LivingEntity ent, String prefix, String value) {
try {
if (prefix.equals("factions") && ent instanceof Player) {
Faction faction = FactionColl.get().getByName(value);
for (MPlayer pl : faction.getMPlayers()) {
if (pl.getPlayer() != null && pl.getPlayer().getUniqueId() != null && pl.getPlayer().getUniqueId().equals(ent.getUniqueId())) {
return true;
}
}
} else if (prefix.equals("factionsenemy") && ent instanceof Player) {
Faction faction = FactionColl.get().getByName(value);
Faction plf = MPlayer.get(((Player) ent).getUniqueId()).getFaction();
if (faction.getRelationTo(plf).equals(Rel.ENEMY)) {
return true;
}
} else if (prefix.equals("factionsally") && ent instanceof Player) {
Faction faction = FactionColl.get().getByName(value);
Faction plf = MPlayer.get(((Player) ent).getUniqueId()).getFaction();
if (faction.getRelationTo(plf).equals(Rel.ALLY)) {
return true;
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
return false;
}
Aggregations