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,73 @@
|
||||
package net.draycia.carbon.events;
|
||||
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
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 PrivateMessageEvent extends Event implements Cancellable {
|
||||
|
||||
/** Bukkit event stuff **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled = false;
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
/** Relevant stuff **/
|
||||
private final ChatUser sender;
|
||||
private final ChatUser target;
|
||||
private final Component senderComponent;
|
||||
private final Component targetComponent;
|
||||
private final String message;
|
||||
|
||||
public PrivateMessageEvent(ChatUser sender, ChatUser target, Component senderComponent, Component targetComponent, String message) {
|
||||
super(!Bukkit.isPrimaryThread());
|
||||
|
||||
this.sender = sender;
|
||||
this.target = target;
|
||||
this.senderComponent = senderComponent;
|
||||
this.targetComponent = targetComponent;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ChatUser getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public ChatUser getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public Component getSenderComponent() {
|
||||
return senderComponent;
|
||||
}
|
||||
|
||||
public Component getTargetComponent() {
|
||||
return targetComponent;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user