public class DamageCalculator
extends java.lang.Object
Constructor and Description |
---|
DamageCalculator() |
Modifier and Type | Method and Description |
---|---|
static void |
applyPvPProtection(org.bukkit.event.player.PlayerInteractEvent event)
Applies pvp protection for a player, based on a potion interaction.
|
static void |
attack(org.bukkit.event.entity.EntityDamageByEntityEvent event)
Determines the amount of damage a player dealt.
|
static void |
defend(org.bukkit.event.entity.EntityDamageEvent event)
Determines the amount of damage a player takes.
|
static boolean |
hasPvPProtection(org.bukkit.entity.Player player)
Checks if a player has a pvp protection effect.
|
static void |
heal(org.bukkit.event.entity.EntityRegainHealthEvent event)
Determines the amount of healing a player receives.
|
static void |
kill(org.bukkit.event.entity.EntityDeathEvent event)
Handles health or mana leech, when a player kills an entity.
|
static void |
reflect(org.bukkit.event.entity.EntityDamageByEntityEvent event)
Determines the amount of damage a player reflects.
|
static void |
setHealth(org.bukkit.entity.Player player,
int hp)
Sets the new health of a player.
|
public static void attack(org.bukkit.event.entity.EntityDamageByEntityEvent event)
event
- The damage event.DamageCalculatorAttack
public static void defend(org.bukkit.event.entity.EntityDamageEvent event)
event
- The damage event.DamageCalculatorDefense
public static void reflect(org.bukkit.event.entity.EntityDamageByEntityEvent event)
event
- The damage event.EquipmentUtils.getReflectionDamage(ItemStack)
,
SkillUtils.callPlayerFixedDamageEvent(Player, Entity, double)
public static void heal(org.bukkit.event.entity.EntityRegainHealthEvent event)
event
- The heal event.ValueIndicator.spawnHealIndicator(org.bukkit.Location, int)
public static void kill(org.bukkit.event.entity.EntityDeathEvent event)
event
- The death event.EquipmentUtils.getEnhancementOnKillHP(ItemStack)
,
EquipmentUtils.getEnhancementOnKillMP(ItemStack)
public static void setHealth(org.bukkit.entity.Player player, int hp)
player
- The player that gets their health set.hp
- The new amount of health.public static boolean hasPvPProtection(org.bukkit.entity.Player player)
player
- The player to check.public static void applyPvPProtection(org.bukkit.event.player.PlayerInteractEvent event)
event
- The interact event.Cooldown.playerFoodConsume(Player)
,
FoodUtils.getPvPProtection(ItemStack)