diff --git a/.classpath b/.classpath
index c53287b..77f87ad 100644
--- a/.classpath
+++ b/.classpath
@@ -7,5 +7,6 @@
+
diff --git a/src/changelog.txt b/src/changelog.txt
index b69c908..7afbfd2 100644
--- a/src/changelog.txt
+++ b/src/changelog.txt
@@ -41,4 +41,5 @@ v0.7:
v0.8:
- Fixed {townformatted} and {nationformatted} to display correctly.
- Updated to use new per world channel formats.
-
\ No newline at end of file
+v0.9:
+ - TownyChat now passes player chat to Dynmap.
\ No newline at end of file
diff --git a/src/com/palmergames/bukkit/TownyChat/Chat.java b/src/com/palmergames/bukkit/TownyChat/Chat.java
index 73de19b..5dc7c8e 100644
--- a/src/com/palmergames/bukkit/TownyChat/Chat.java
+++ b/src/com/palmergames/bukkit/TownyChat/Chat.java
@@ -7,6 +7,7 @@ import org.bukkit.event.Event.Priority;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
+import org.dynmap.DynmapAPI;
import com.ensifera.animosity.craftirc.CraftIRC;
import com.palmergames.bukkit.TownyChat.CraftIRCHandler;
@@ -30,6 +31,7 @@ public class Chat extends JavaPlugin {
protected PluginManager pm;
private Towny towny = null;
private CraftIRC craftIRC = null;
+ private DynmapAPI dynMap = null;
private CraftIRCHandler irc = null;
@@ -83,11 +85,16 @@ public class Chat extends JavaPlugin {
logger.warning("Non number format found for craftIRC version string!");
}
}
+
+ test = pm.getPlugin("dynmap");
+ if (test != null) {
+ dynMap = (DynmapAPI) test;
+ }
}
public void registerEvents() {
- TownyPlayerListener = new TownyPlayerHighestListener(towny, irc);
+ TownyPlayerListener = new TownyPlayerHighestListener(towny, 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);
diff --git a/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java b/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java
index 06eb143..15bf089 100644
--- a/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java
+++ b/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java
@@ -6,6 +6,7 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerListener;
+import org.dynmap.DynmapAPI;
import com.earth2me.essentials.User;
import com.palmergames.bukkit.towny.NotRegisteredException;
import com.palmergames.bukkit.towny.Towny;
@@ -23,11 +24,13 @@ import com.palmergames.util.StringMgmt;
public class TownyPlayerHighestListener extends PlayerListener {
private final Towny plugin;
- private CraftIRCHandler ircHander;
+ private final CraftIRCHandler ircHander;
+ private final DynmapAPI dynMap;
- public TownyPlayerHighestListener(Towny instance, CraftIRCHandler irc) {
+ public TownyPlayerHighestListener(Towny instance, CraftIRCHandler irc, DynmapAPI dynMap) {
this.plugin = instance;
this.ircHander = irc;
+ this.dynMap = dynMap;
}
@Override
@@ -299,6 +302,9 @@ public class TownyPlayerHighestListener extends PlayerListener {
if (ircHander != null)
ircHander.IRCSender(msg);
+ if (dynMap != null)
+ dynMap.postPlayerMessageToWeb(player, event.getMessage());
+
for (Player test : plugin.getTownyUniverse().getOnlinePlayers()) {
if (!plugin.isPermissions() || (plugin.isPermissions() && TownyUniverse.getPermissionSource().hasPermission(test, TownySettings.getChatChannelPermission(command)))) {
diff --git a/src/plugin.yml b/src/plugin.yml
index 10b9398..261b4d3 100644
--- a/src/plugin.yml
+++ b/src/plugin.yml
@@ -1,6 +1,6 @@
name: TownyChat
main: com.palmergames.bukkit.TownyChat.Chat
-version: 0.8
+version: 0.9
author: ElgarL
website: http://code.google.com/a/eclipselabs.org/p/towny/
description: >