Fix for PowerLossEvent Messages

This commit is contained in:
alkarin 2012-12-17 11:43:57 -06:00
parent 6eb23a200e
commit efcf97d375

View File

@ -89,17 +89,17 @@ public class FactionsEntityListener implements Listener
// call Event // call Event
Bukkit.getPluginManager().callEvent(powerLossEvent); Bukkit.getPluginManager().callEvent(powerLossEvent);
// Call player onDeath if the event is not cancelled
if(!powerLossEvent.isCancelled())
{
fplayer.onDeath();
}
// Send the message from the powerLossEvent // Send the message from the powerLossEvent
final String msg = powerLossEvent.getMessage(); final String msg = powerLossEvent.getMessage();
if (msg != null && !msg.isEmpty()) if (msg != null && !msg.isEmpty())
{ {
fplayer.msg(msg,fplayer.getPowerRounded(),fplayer.getPowerMaxRounded()); fplayer.msg(msg,fplayer.getPowerRounded(),fplayer.getPowerMaxRounded());
} }
// Call player onDeath if the event is not cancelled
if(!powerLossEvent.isCancelled())
{
fplayer.onDeath();
}
} }
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)