Browse Source

Check if player has a mcMMOPlayer object

Fixes #1976
TfT_02 11 years ago
parent
commit
69a2a5cfff
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Changelog.txt
  2. 1 1
      src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

+ 1 - 0
Changelog.txt

@@ -13,6 +13,7 @@ Version 1.5.01-dev
  + Added support for `MATERIAL|data` format in treasures.yml
  = Fixed bug where the Updater was running on the main thread.
  = Fixed bug when players would use /ptp without being in a party
+ = Fixed bug where player didn't have a mcMMOPlayer object in AsyncPlayerChatEvent
  ! Vanished players no longer get hit by AoE effects
 
 Version 1.5.00

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -637,7 +637,7 @@ public class PlayerListener implements Listener {
     public void onPlayerChat(AsyncPlayerChatEvent event) {
         Player player = event.getPlayer();
 
-        if (Misc.isNPCEntity(player)) {
+        if (Misc.isNPCEntity(player) || !UserManager.hasPlayerDataKey(player)) {
             return;
         }