- Updated for the new Bukkit Event system.
This commit is contained in:
ElgarL committed 2012-01-21 12:50:57 +00:00
1 parent 5ea30523d2
commit dca5a8db13
5 files changed
+19 -15

No files matched your search

+5 -5
View File
@@ -2,11 +2,11 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="../../lib/bukkit-0.0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="../../lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="../../lib/bukkit-1.1-R1-20120119.234317-45.jar"/>
<classpathentry kind="lib" path="../../lib/craftbukkit-1.1-R1-20120120.104802-76.jar"/>
<classpathentry kind="lib" path="../../lib/Towny.jar"/>
<classpathentry kind="lib" path="E:/ElgarL/lib/Essentials.jar"/>
<classpathentry kind="lib" path="E:/ElgarL/lib/CraftIRC-3.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="E:/ElgarL/lib/dynmap-api.jar"/>
<classpathentry kind="lib" path="../../lib/Essentials.jar"/>
<classpathentry kind="lib" path="../../lib/CraftIRC-3.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="../../lib/dynmap-api.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+3 -1
View File
@@ -77,4 +77,6 @@ v0.13:
- Fixed channel modes when defaulting to a global channel not to place you in one of your own (Lonely spam).
v0.14:
- The default permission node for the global chat channel has changed to 'towny.chat.general'
- TownyChat now registers is't permissions with Bukkit.
- TownyChat now registers is't permissions with Bukkit.
v0.15:
- Updated for the new Bukkit Event system.
@@ -3,8 +3,6 @@ package com.palmergames.bukkit.TownyChat;
import java.util.HashMap;
import java.util.logging.Logger;
import org.bukkit.event.Event;
import org.bukkit.event.Event.Priority;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
@@ -110,8 +108,9 @@ public class Chat extends JavaPlugin {
public void registerEvents() {
TownyPlayerListener = new TownyPlayerHighestListener(this, irc, dynMap);
pm.registerEvent(Event.Type.PLAYER_CHAT, TownyPlayerListener, Priority.Highest, this); //Run this lower so we go before herochat? ( it needs to see us cancel).
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, TownyPlayerListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.PLAYER_CHAT, TownyPlayerListener, Priority.Highest, this); //Run this lower so we go before herochat? ( it needs to see us cancel).
//pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, TownyPlayerListener, Priority.Highest, this);
pm.registerEvents(TownyPlayerListener, this);
}
@@ -3,9 +3,12 @@ package com.palmergames.bukkit.TownyChat.event;
import java.util.HashMap;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerListener;
//import org.bukkit.event.player.PlayerListener;
import org.dynmap.DynmapAPI;
import com.earth2me.essentials.User;
@@ -27,7 +30,7 @@ import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.palmergames.bukkit.util.ChatTools;
import com.palmergames.util.StringMgmt;
public class TownyPlayerHighestListener extends PlayerListener {
public class TownyPlayerHighestListener implements Listener {
private final Chat plugin;
private final CraftIRCHandler ircHander;
private final DynmapAPI dynMap;
@@ -40,7 +43,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
this.dynMap = dynMap;
}
@Override
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
@@ -91,7 +94,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
}
}
@Override
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerChat(PlayerChatEvent event) {
Player player = event.getPlayer();
+1 -1
View File
@@ -1,6 +1,6 @@
name: TownyChat
main: com.palmergames.bukkit.TownyChat.Chat
version: 0.14
version: 0.15
author: ElgarL, Shade
website: http://code.google.com/a/eclipselabs.org/p/towny/
description: >