diff options
3 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java new file mode 100644 index 00000000..270314e8 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java @@ -0,0 +1,30 @@ +package org.bukkit.event.player;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+
+/**
+ * This event is called after a player registers or unregisters a new plugin channel.
+ */
+public abstract class PlayerChannelEvent extends PlayerEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final String channel;
+
+ public PlayerChannelEvent(final Player player, final String channel) {
+ super(player);
+ this.channel = channel;
+ }
+
+ public final String getChannel() {
+ return channel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java new file mode 100644 index 00000000..c0b47aa4 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java @@ -0,0 +1,13 @@ +package org.bukkit.event.player;
+
+import org.bukkit.entity.Player;
+
+/**
+ * This is called immediately after a player registers for a plugin channel.
+ */
+public class PlayerRegisterChannelEvent extends PlayerChannelEvent {
+
+ public PlayerRegisterChannelEvent(final Player player, final String channel) {
+ super(player, channel);
+ }
+}
diff --git a/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java new file mode 100644 index 00000000..e0a6f3d4 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java @@ -0,0 +1,13 @@ +package org.bukkit.event.player;
+
+import org.bukkit.entity.Player;
+
+/**
+ * This is called immediately after a player unregisters for a plugin channel.
+ */
+public class PlayerUnregisterChannelEvent extends PlayerChannelEvent {
+
+ public PlayerUnregisterChannelEvent(final Player player, final String channel) {
+ super(player, channel);
+ }
+}
|