use of com.massivecraft.factions.FPlayer in project PvPManager by ChanceSD.
the class FactionsUUIDHook method canAttack.
@Override
public final boolean canAttack(final Player attacker, final Player defender) {
final FPlayer fAttacker = FPlayers.getInstance().getByPlayer(attacker);
final FPlayer fDefender = FPlayers.getInstance().getByPlayer(defender);
return fAttacker.getRelationTo(fDefender).isAtMost(Relation.NEUTRAL);
}
use of com.massivecraft.factions.FPlayer in project Histeria by zelytra.
the class PvPLogger method onPlayerDamage.
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent e) {
if (!(e.getEntity() instanceof Player && e.getDamager() instanceof Player))
return;
Player player = (Player) e.getEntity();
Player damager = (Player) e.getDamager();
if (HGuard.getByLocation(damager.getLocation()) != null)
if (!HGuard.getByLocation(damager.getLocation()).isPvp())
return;
if (Histeria.isSaberFaction()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
FPlayer fdamager = FPlayers.getInstance().getByPlayer(damager);
if (fplayer.getTag().equalsIgnoreCase(fdamager.getTag())) {
if (!fplayer.getFaction().isWilderness()) {
return;
}
}
}
CustomPlayer.getCustomPlayer(player.getName()).getPvp().setPvP();
CustomPlayer.getCustomPlayer(damager.getName()).getPvp().setPvP();
}
Aggregations