public class CombatUtil
extends java.lang.Object
Constructor and Description |
---|
CombatUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areAllAllies(java.util.List<Nation> possibleAllies)
Test if all the listed nations are allies
|
static boolean |
canAttackEnemy(java.lang.String a,
java.lang.String b)
Can resident a attack resident b?
|
static boolean |
isAlly(java.lang.String attackingResident,
java.lang.String defendingResident)
Is the defending resident an ally of the attacking resident?
|
static boolean |
isAlly(Town a,
Town b)
Is town b an ally of town a?
|
static boolean |
isEnemy(java.lang.String a,
java.lang.String b)
Is resident b an enemy of resident a?
|
static boolean |
isEnemy(Town a,
Town b)
Is town b an enemy of town a?
|
boolean |
isEnemyTownBlock(org.bukkit.entity.Player player,
WorldCoord worldCoord)
Does this WorldCoord fall within a plot owned by an enemy town?
|
static boolean |
isPvPPlot(org.bukkit.entity.Player attacker,
org.bukkit.entity.Player defender)
Return true if both attacker and defender are in Arena Plots.
|
static boolean |
isWorldPvP(TownyWorld world)
Is PvP enabled in this world?
|
static boolean |
preventDamageCall(Towny plugin,
org.bukkit.entity.Entity attacker,
org.bukkit.entity.Entity defender)
Tests the attacker against defender to see if we need to cancel
the damage event due to world PvP, Plot PvP or Friendly Fire settings.
|
static boolean |
preventDamageCall(Towny plugin,
TownyWorld world,
org.bukkit.entity.Entity attackingEntity,
org.bukkit.entity.Entity defendingEntity,
org.bukkit.entity.Player attackingPlayer,
org.bukkit.entity.Player defendingPlayer)
Tests the attacker against defender to see if we need to cancel
the damage event due to world PvP, Plot PvP or Friendly Fire settings.
|
static boolean |
preventFriendlyFire(org.bukkit.entity.Player attacker,
org.bukkit.entity.Player defender)
Should we be preventing friendly fire?
|
static boolean |
preventPvP(TownyWorld world,
TownBlock townBlock)
Is PvP disabled in this TownBlock?
Checks the world if the TownBlock is null.
|
public static boolean preventDamageCall(Towny plugin, org.bukkit.entity.Entity attacker, org.bukkit.entity.Entity defender)
attacker
- defender
- public static boolean preventDamageCall(Towny plugin, TownyWorld world, org.bukkit.entity.Entity attackingEntity, org.bukkit.entity.Entity defendingEntity, org.bukkit.entity.Player attackingPlayer, org.bukkit.entity.Player defendingPlayer)
world
- attackingEntity
- defendingEntity
- attackingPlayer
- defendingPlayer
- public static boolean preventPvP(TownyWorld world, TownBlock townBlock)
townBlock
- public static boolean isWorldPvP(TownyWorld world)
world
- public static boolean preventFriendlyFire(org.bukkit.entity.Player attacker, org.bukkit.entity.Player defender)
attacker
- defender
- public static boolean isPvPPlot(org.bukkit.entity.Player attacker, org.bukkit.entity.Player defender)
attacker
- defender
- public static boolean isAlly(java.lang.String attackingResident, java.lang.String defendingResident)
attackingResident
- defendingResident
- public static boolean isAlly(Town a, Town b)
a
- b
- public static boolean canAttackEnemy(java.lang.String a, java.lang.String b)
a
- b
- public static boolean areAllAllies(java.util.List<Nation> possibleAllies)
possibleAllies
- public static boolean isEnemy(java.lang.String a, java.lang.String b)
a
- b
- public static boolean isEnemy(Town a, Town b)
a
- b
- public boolean isEnemyTownBlock(org.bukkit.entity.Player player, WorldCoord worldCoord)
player
- worldCoord
-