mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Players need to have unique objectives
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
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.HandlerList;
|
||||
@ -12,13 +14,16 @@ import org.bukkit.event.player.PlayerEvent;
|
||||
public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancellable {
|
||||
private boolean isCancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
protected String notificationMessage;
|
||||
protected ChatMessageType chatMessageType;
|
||||
|
||||
protected TextComponent notificationTextComponent;
|
||||
protected final NotificationType notificationType;
|
||||
|
||||
public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, String notificationMessage) {
|
||||
public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, net.md_5.bungee.api.chat.TextComponent notificationTextComponent, ChatMessageType chatMessageType) {
|
||||
super(who);
|
||||
this.notificationType = notificationType;
|
||||
this.notificationMessage = notificationMessage;
|
||||
this.notificationTextComponent = notificationTextComponent;
|
||||
this.chatMessageType = chatMessageType;
|
||||
isCancelled = false;
|
||||
}
|
||||
|
||||
@ -26,6 +31,22 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell
|
||||
* Getters & Setters
|
||||
*/
|
||||
|
||||
public TextComponent getNotificationTextComponent() {
|
||||
return notificationTextComponent;
|
||||
}
|
||||
|
||||
public void setNotificationTextComponent(TextComponent notificationTextComponent) {
|
||||
this.notificationTextComponent = notificationTextComponent;
|
||||
}
|
||||
|
||||
public ChatMessageType getChatMessageType() {
|
||||
return chatMessageType;
|
||||
}
|
||||
|
||||
public void setChatMessageType(ChatMessageType chatMessageType) {
|
||||
this.chatMessageType = chatMessageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The notification type for this event
|
||||
* @return this event's notification type
|
||||
@ -34,22 +55,6 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell
|
||||
return notificationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The message delivered to players by this notification
|
||||
* @return the message that will be delivered to the player
|
||||
*/
|
||||
public String getNotificationMessage() {
|
||||
return notificationMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the notification message
|
||||
* @param newMessage the new replacement message
|
||||
*/
|
||||
public void setNotificationMessage(String newMessage) {
|
||||
notificationMessage = newMessage;
|
||||
}
|
||||
|
||||
/*
|
||||
* Custom Event Boilerplate
|
||||
*/
|
||||
|
Reference in New Issue
Block a user