From c4e4d31279eb88d4a83f6668af548f184a9e6019 Mon Sep 17 00:00:00 2001 From: JL-III Date: Fri, 1 Sep 2023 14:38:12 -0500 Subject: [PATCH] add access to player in McMMoPlayerNotificationEvent --- .../events/skills/McMMOPlayerNotificationEvent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java b/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java index 1b0c17949..0003642a1 100644 --- a/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java +++ b/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java @@ -26,9 +26,11 @@ public class McMMOPlayerNotificationEvent extends Event implements Cancellable { protected Component notificationTextComponent; protected final NotificationType notificationType; + private final Player who; - public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, Component notificationTextComponent, McMMOMessageType chatMessageType, boolean isMessageAlsoBeingSentToChat) { + public McMMOPlayerNotificationEvent(@NotNull Player who, NotificationType notificationType, Component notificationTextComponent, McMMOMessageType chatMessageType, boolean isMessageAlsoBeingSentToChat) { super(false); + this.who = who; this.notificationType = notificationType; this.notificationTextComponent = notificationTextComponent; this.chatMessageType = chatMessageType; @@ -98,4 +100,8 @@ public class McMMOPlayerNotificationEvent extends Event implements Cancellable { public void setCancelled(boolean b) { isCancelled = b; } + + public Player getWho() { + return who; + } }