summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-06-20 23:15:31 -0500
committerWesley Wolfe <weswolf@aol.com>2012-06-21 02:39:59 -0500
commit57763845d04542e9973d1e9564558159832e7d49 (patch)
treed0876e4104df537158701b10e15065038268f9f3 /src/main/java/org
parent9f37f705272d633c8cf316b3522833ad6441c1d9 (diff)
downloadcraftbukkit-57763845d04542e9973d1e9564558159832e7d49.tar
craftbukkit-57763845d04542e9973d1e9564558159832e7d49.tar.gz
craftbukkit-57763845d04542e9973d1e9564558159832e7d49.tar.lz
craftbukkit-57763845d04542e9973d1e9564558159832e7d49.tar.xz
craftbukkit-57763845d04542e9973d1e9564558159832e7d49.zip
Implement plugin channel events. Addresses BUKKIT-1844
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3291608f..b3da75ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -39,7 +39,9 @@ import org.bukkit.craftbukkit.map.RenderData;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
+import org.bukkit.event.player.PlayerRegisterChannelEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
+import org.bukkit.event.player.PlayerUnregisterChannelEvent;
import org.bukkit.inventory.InventoryView.Property;
import org.bukkit.map.MapView;
import org.bukkit.metadata.MetadataValue;
@@ -744,11 +746,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {
- channels.add(channel);
+ if (channels.add(channel)) {
+ server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel));
+ }
}
public void removeChannel(String channel) {
- channels.remove(channel);
+ if (channels.remove(channel)) {
+ server.getPluginManager().callEvent(new PlayerUnregisterChannelEvent(this, channel));
+ }
}
public Set<String> getListeningPluginChannels() {