Search in sources :

Example 1 with Absorption

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);
}
Also used : Absorption(com.archyx.aureliumskills.mana.Absorption) ManaAbilityProvider(com.archyx.aureliumskills.mana.ManaAbilityProvider) PlayerData(com.archyx.aureliumskills.data.PlayerData)

Aggregations

PlayerData (com.archyx.aureliumskills.data.PlayerData)1 Absorption (com.archyx.aureliumskills.mana.Absorption)1 ManaAbilityProvider (com.archyx.aureliumskills.mana.ManaAbilityProvider)1