use of com.archyx.aureliumskills.mana.Absorption in project AureliumSkills by Archy-X.
the class DamageListener method onDamaged.
private void onDamaged(EntityDamageByEntityEvent event, Player player) {
// Check disabled world
if (plugin.getWorldManager().isInDisabledWorld(player.getLocation())) {
return;
}
// Gets player skill
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
if (playerData == null)
return;
// Checks for absorption activation and applies
ManaAbilityProvider provider = plugin.getManaAbilityManager().getProvider(MAbility.ABSORPTION);
if (provider instanceof Absorption) {
Absorption absorption = (Absorption) provider;
absorption.handleAbsorption(event, player, playerData);
}
if (event.isCancelled())
return;
// Handles toughness
Toughness.onDamage(event, playerData);
// Handles mob master
defenseAbilities.mobMaster(event, playerData);
// Handles shielding
defenseAbilities.shielding(event, playerData, player);
}
Aggregations