diff --git a/src/main/java/net/md_5/bungee/plugin/PluginMessageEvent.java b/src/main/java/net/md_5/bungee/plugin/PluginMessageEvent.java new file mode 100644 index 000000000..4db6b5fb6 --- /dev/null +++ b/src/main/java/net/md_5/bungee/plugin/PluginMessageEvent.java @@ -0,0 +1,45 @@ +package net.md_5.bungee.plugin; + +import lombok.Data; +import net.md_5.bungee.UserConnection; + +/** + * Event called when the decision is made to decide which server to connect to. + */ +@Data +public class PluginMessageEvent implements Cancellable +{ + /** + * Canceled state. + */ + private boolean cancelled; + /** + * Message to use when kicking if this event is canceled. + */ + private String cancelReason; + /** + * Whether this packet is destined for the server or the client + */ + private final Destination destination; + /** + * User in question + */ + private final UserConnection connection; + /** + * Tag specified for this plugin message. + */ + private String tag; + /** + * Data contained in this plugin message. + */ + private String data; + + /** + * An enum that signifies the destination for this packet + */ + public enum Destination + { + SERVER, + CLIENT + } +}