mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Single module setup
This commit is contained in:
1 parent
ad9a794156
commit
66217f6534
70 files changed
+92
-138
No files matched your search
@@ -0,0 +1,85 @@
|
||||
package net.draycia.carbon.events;
|
||||
|
||||
import net.draycia.carbon.channels.ChatChannel;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ChatFormatEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLERS_LIST = new HandlerList();
|
||||
private boolean isCancelled = false;
|
||||
|
||||
private final ChatUser sender;
|
||||
private final ChatUser target;
|
||||
|
||||
private ChatChannel chatChannel;
|
||||
private String format;
|
||||
private String message;
|
||||
|
||||
public ChatFormatEvent(ChatUser sender, ChatUser target, ChatChannel chatChannel, String format, String message) {
|
||||
super(!Bukkit.isPrimaryThread());
|
||||
|
||||
this.sender = sender;
|
||||
this.target = target;
|
||||
|
||||
this.chatChannel = chatChannel;
|
||||
this.format = format;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS_LIST;
|
||||
}
|
||||
|
||||
public ChatUser getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public ChatUser getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public ChatChannel getChannel() {
|
||||
return chatChannel;
|
||||
}
|
||||
|
||||
public void setChannel(ChatChannel chatChannel) {
|
||||
this.chatChannel = chatChannel;
|
||||
}
|
||||
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user