Przeglądaj źródła

PlayerNotification now marked async

nossr50 6 lat temu
rodzic
commit
0adaa0ba66

+ 1 - 0
Changelog.txt

@@ -9,6 +9,7 @@ Key:
 
 Version 2.1.48
     1.14 Support
+    (API) Player notification events are now marked async
 
 Version 2.1.47
     Fix NPE when party leader is offline and players grab a party list

+ 3 - 2
src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java

@@ -5,13 +5,14 @@ import net.md_5.bungee.api.ChatMessageType;
 import net.md_5.bungee.api.chat.TextComponent;
 import org.bukkit.entity.Player;
 import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
 import org.bukkit.event.HandlerList;
 import org.bukkit.event.player.PlayerEvent;
 
 /**
  * This event is sent for when mcMMO informs a player about various important information
  */
-public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancellable {
+public class McMMOPlayerNotificationEvent extends Event implements Cancellable {
     private boolean isCancelled;
     /*
      * Messages can be sent to both places, as configured in advanced.yml
@@ -27,7 +28,7 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell
     protected final NotificationType notificationType;
 
     public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, TextComponent notificationTextComponent, ChatMessageType chatMessageType, boolean isMessageAlsoBeingSentToChat) {
-        super(who);
+        super(true);
         this.notificationType = notificationType;
         this.notificationTextComponent = notificationTextComponent;
         this.chatMessageType = chatMessageType;