Search in sources :

Example 1 with PlayerPunishEvent

use of com.github.sirblobman.combatlogx.api.event.PlayerPunishEvent in project CombatLogX by SirBlobman.

the class PunishManager method punish.

@Override
public boolean punish(Player player, UntagReason punishReason, LivingEntity previousEnemy) {
    PlayerPunishEvent punishEvent = new PlayerPunishEvent(player, punishReason, previousEnemy);
    PluginManager pluginManager = Bukkit.getPluginManager();
    pluginManager.callEvent(punishEvent);
    if (punishEvent.isCancelled()) {
        return false;
    }
    increasePunishmentCount(player);
    runKillCheck(player);
    runPunishCommands(player, previousEnemy, this.punishCommandList);
    runSpecialPunishments(player, previousEnemy);
    return true;
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) PlayerPunishEvent(com.github.sirblobman.combatlogx.api.event.PlayerPunishEvent)

Aggregations

PlayerPunishEvent (com.github.sirblobman.combatlogx.api.event.PlayerPunishEvent)1 PluginManager (org.bukkit.plugin.PluginManager)1