PlayerNotification now marked async

This commit is contained in:
nossr50 2019-04-23 01:10:09 -07:00
parent 432a4aa330
commit 0adaa0ba66
2 changed files with 4 additions and 2 deletions

View File

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

View File

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