This commit is contained in:
GJ 2012-05-24 10:30:07 -04:00
parent 2b469c385c
commit c40e4ee9ee

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.listeners;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
@ -10,17 +11,23 @@ import com.gmail.nossr50.util.Hardcore;
import com.gmail.nossr50.util.Permissions;
public class HardcoreListener implements Listener {
@EventHandler()
public void PlayerDeathEvent(PlayerDeathEvent event) {
/**
* Monitor PlayerDeath events.
*
* @param event The event to monitor
*/
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity(); //Note this returns a Player object for this subevent
if(!Permissions.getInstance().hardcoremodeBypass(player)) {
if(player.getKiller() instanceof Player) {
if(Config.getInstance().getHardcoreVampirismEnabled()) {
if (!Permissions.getInstance().hardcoremodeBypass(player)) {
if (player.getKiller() instanceof Player) {
if (Config.getInstance().getHardcoreVampirismEnabled()) {
Hardcore.invokeVampirism(((Player)player.getKiller()), player);
}
}
Hardcore.invokeStatPenalty(player);
}
}