From 30f5c761d9d0a1e8c63f70953bd8c6aacc81e45b Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 10 Apr 2013 17:04:32 -0400 Subject: [PATCH] Because some plugins do stupid things. --- .../com/gmail/nossr50/listeners/PlayerListener.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 703438de6..939ebc2c3 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -59,9 +59,15 @@ public class PlayerListener implements Listener { this.plugin = plugin; } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onPlayerDeathHighest(PlayerDeathEvent event) { + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onPlayerDeathLowest(PlayerDeathEvent event) { String deathMessage = event.getDeathMessage(); + + if (deathMessage == null) { + mcMMO.p.getLogger().severe("You have another plugin causing null death messages. mcMMO cannot process this death message."); + return; + } + deathMessage.replaceAll("(?:\u00A7(?:[0-9A-FK-ORa-fk-or]){1}(?:[\u2764\u25A0]{1,10})){1,2}", "a mob"); event.setDeathMessage(deathMessage); }