diff options
author | ementalo <ementalodev@gmx.co.uk> | 2012-08-04 09:25:54 +0100 |
---|---|---|
committer | ementalo <ementalodev@gmx.co.uk> | 2012-08-04 09:25:54 +0100 |
commit | af73c11638fda0c65fa68506d301b2a68b780bf6 (patch) | |
tree | 52e4cf55b5480742ff6830c76e82b9b0c92d8bdc /EssentialsChat | |
parent | 1a07815f4b535cc80c32579b010294eb4b49ecfc (diff) | |
download | Essentials-af73c11638fda0c65fa68506d301b2a68b780bf6.tar Essentials-af73c11638fda0c65fa68506d301b2a68b780bf6.tar.gz Essentials-af73c11638fda0c65fa68506d301b2a68b780bf6.tar.lz Essentials-af73c11638fda0c65fa68506d301b2a68b780bf6.tar.xz Essentials-af73c11638fda0c65fa68506d301b2a68b780bf6.zip |
CB #2289 Bukkit #1512
Change PlayerChatEvent to AsyncPlayerChatEvent
Diffstat (limited to 'EssentialsChat')
6 files changed, 24 insertions, 24 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java index 3148fe0ff..f16579a4d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java @@ -8,7 +8,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentSkipListMap; import java.util.logging.Level; import java.util.logging.Logger; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -34,7 +34,7 @@ public class EssentialsChat extends JavaPlugin } chatListener = new ConcurrentSkipListMap<String, IEssentialsChatListener>(); - final Map<PlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<PlayerChatEvent, ChatStore>()); + final Map<AsyncPlayerChatEvent, ChatStore> chatStore = Collections.synchronizedMap(new HashMap<AsyncPlayerChatEvent, ChatStore>()); final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener, chatStore); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index 052479aed..8ca16fbbb 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -12,7 +12,7 @@ import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; //TODO: Translate the local/spy tags public abstract class EssentialsChatPlayer implements Listener @@ -21,12 +21,12 @@ public abstract class EssentialsChatPlayer implements Listener protected final static Logger logger = Logger.getLogger("Minecraft"); protected final transient Map<String, IEssentialsChatListener> listeners; protected final transient Server server; - protected final transient Map<PlayerChatEvent, ChatStore> chatStorage; + protected final transient Map<AsyncPlayerChatEvent, ChatStore> chatStorage; public EssentialsChatPlayer(final Server server, final IEssentials ess, final Map<String, IEssentialsChatListener> listeners, - final Map<PlayerChatEvent, ChatStore> chatStorage) + final Map<AsyncPlayerChatEvent, ChatStore> chatStorage) { this.ess = ess; this.listeners = listeners; @@ -34,11 +34,11 @@ public abstract class EssentialsChatPlayer implements Listener this.chatStorage = chatStorage; } - public void onPlayerChat(final PlayerChatEvent event) + public void onPlayerChat(final AsyncPlayerChatEvent event) { } - public boolean isAborted(final PlayerChatEvent event) + public boolean isAborted(final AsyncPlayerChatEvent event) { if (event.isCancelled()) { @@ -69,17 +69,17 @@ public abstract class EssentialsChatPlayer implements Listener } } - public ChatStore getChatStore(final PlayerChatEvent event) + public ChatStore getChatStore(final AsyncPlayerChatEvent event) { return chatStorage.get(event); } - public void setChatStore(final PlayerChatEvent event, final ChatStore chatStore) + public void setChatStore(final AsyncPlayerChatEvent event, final ChatStore chatStore) { chatStorage.put(event, chatStore); } - public ChatStore delChatStore(final PlayerChatEvent event) + public ChatStore delChatStore(final AsyncPlayerChatEvent event) { return chatStorage.remove(event); } @@ -89,7 +89,7 @@ public abstract class EssentialsChatPlayer implements Listener charge.charge(user); } - protected boolean charge(final PlayerChatEvent event, final ChatStore chatStore) + protected boolean charge(final AsyncPlayerChatEvent event, final ChatStore chatStore) { try { @@ -104,7 +104,7 @@ public abstract class EssentialsChatPlayer implements Listener return true; } - protected void sendLocalChat(final PlayerChatEvent event, final ChatStore chatStore) + protected void sendLocalChat(final AsyncPlayerChatEvent event, final ChatStore chatStore) { event.setCancelled(true); final User sender = chatStore.getUser(); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java index e8f785228..db728bd09 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java @@ -5,7 +5,7 @@ import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer @@ -13,14 +13,14 @@ public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer public EssentialsChatPlayerListenerHighest(final Server server, final IEssentials ess, final Map<String, IEssentialsChatListener> listeners, - final Map<PlayerChatEvent, ChatStore> chatStorage) + final Map<AsyncPlayerChatEvent, ChatStore> chatStorage) { super(server, ess, listeners, chatStorage); } @EventHandler(priority = EventPriority.HIGHEST) @Override - public void onPlayerChat(final PlayerChatEvent event) + public void onPlayerChat(final AsyncPlayerChatEvent event) { final ChatStore chatStore = delChatStore(event); if (isAborted(event)) diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 79ff4994a..410dc3b3b 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -9,7 +9,7 @@ import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer @@ -17,14 +17,14 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer public EssentialsChatPlayerListenerLowest(final Server server, final IEssentials ess, final Map<String, IEssentialsChatListener> listeners, - final Map<PlayerChatEvent, ChatStore> chatStorage) + final Map<AsyncPlayerChatEvent, ChatStore> chatStorage) { super(server, ess, listeners, chatStorage); } @EventHandler(priority = EventPriority.LOWEST) @Override - public void onPlayerChat(final PlayerChatEvent event) + public void onPlayerChat(final AsyncPlayerChatEvent event) { if (isAborted(event)) { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java index fdaccdc8d..910518302 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java @@ -8,7 +8,7 @@ import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer @@ -16,14 +16,14 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer public EssentialsChatPlayerListenerNormal(final Server server, final IEssentials ess, final Map<String, IEssentialsChatListener> listeners, - final Map<PlayerChatEvent, ChatStore> chatStorage) + final Map<AsyncPlayerChatEvent, ChatStore> chatStorage) { super(server, ess, listeners, chatStorage); } @EventHandler(priority = EventPriority.NORMAL) @Override - public void onPlayerChat(final PlayerChatEvent event) + public void onPlayerChat(final AsyncPlayerChatEvent event) { if (isAborted(event)) { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/IEssentialsChatListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/IEssentialsChatListener.java index 5c9c5c219..abf5893ea 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/IEssentialsChatListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/IEssentialsChatListener.java @@ -1,12 +1,12 @@ package com.earth2me.essentials.chat; import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; public interface IEssentialsChatListener { - boolean shouldHandleThisChat(PlayerChatEvent event); + boolean shouldHandleThisChat(AsyncPlayerChatEvent event); - String modifyMessage(PlayerChatEvent event, Player target, String message); + String modifyMessage(AsyncPlayerChatEvent event, Player target, String message); } |