Players need to have unique objectives

This commit is contained in:
nossr50
2019-01-11 05:26:05 -08:00
parent adc83d29a7
commit f11b98c29d
14 changed files with 262 additions and 90 deletions

View File

@ -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
*/