diff --git a/.classpath b/.classpath
index 89b3346..15caa28 100644
--- a/.classpath
+++ b/.classpath
@@ -9,5 +9,6 @@
+
diff --git a/src/changelog.txt b/src/changelog.txt
index 32382e3..0eea424 100644
--- a/src/changelog.txt
+++ b/src/changelog.txt
@@ -88,4 +88,5 @@ v0.16:
v0.17:
- If a player has no permissions for any channel but we are still set to modify chat, remove the channelTag and msgcolour entries.
- Fix Spam timer to work in milliseconds so values of 0.5 actually work.
- - Fix craftIRC hook to not spam console with an invalid number format error if the wrong version is detected.
\ No newline at end of file
+ - Fix craftIRC hook to not spam console with an invalid number format error if the wrong version is detected.
+ - Add support for our updated HeroicDeath jar (hopefully someone will take over support for heroic Death now it's updated).
\ 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 537e65b..cbff400 100644
--- a/src/com/palmergames/bukkit/TownyChat/Chat.java
+++ b/src/com/palmergames/bukkit/TownyChat/Chat.java
@@ -14,6 +14,7 @@ import com.palmergames.bukkit.TownyChat.CraftIRCHandler;
import com.palmergames.bukkit.TownyChat.Command.TownyChatCommand;
import com.palmergames.bukkit.TownyChat.channels.ChannelsHolder;
import com.palmergames.bukkit.TownyChat.config.ConfigurationHandler;
+import com.palmergames.bukkit.TownyChat.event.HeroicDeathForwarder;
import com.palmergames.bukkit.TownyChat.event.TownyPlayerHighestListener;
import com.palmergames.bukkit.TownyChat.tasks.onLoadedTask;
import com.palmergames.bukkit.TownyChat.util.FileMgmt;
@@ -40,6 +41,8 @@ public class Chat extends JavaPlugin {
private DynmapAPI dynMap = null;
private CraftIRCHandler irc = null;
+ private HeroicDeathForwarder heroicDeathListener = null;
+
@Override
public void onEnable() {
@@ -80,6 +83,10 @@ public class Chat extends JavaPlugin {
public void onDisable() {
unregisterPermissions();
// reset any handles
+ irc = null;
+ craftIRC = null;
+ dynMap = null;
+ heroicDeathListener= null;
towny = null;
pm = null;
logger = null;
@@ -91,7 +98,9 @@ public class Chat extends JavaPlugin {
test = pm.getPlugin("Towny");
if (test != null && test instanceof Towny)
towny = (Towny) test;
-
+ /**
+ * Hook craftIRC
+ */
test = pm.getPlugin("CraftIRC");
if (test != null) {
try {
@@ -105,6 +114,17 @@ public class Chat extends JavaPlugin {
}
}
+ /**
+ * If we found craftIRC check for HeroicDeath
+ */
+ if (irc != null) {
+ test = pm.getPlugin("HeroicDeath");
+ if (test != null) {
+ heroicDeathListener = new HeroicDeathForwarder(irc);
+ logger.info("[TownyChat] Found and attempting to relay Heroic Death messages to craftIRC.");
+ }
+ }
+
test = pm.getPlugin("dynmap");
if (test != null) {
dynMap = (DynmapAPI) test;
@@ -116,6 +136,7 @@ public class Chat extends JavaPlugin {
TownyPlayerListener = new TownyPlayerHighestListener(this, irc, dynMap);
pm.registerEvents(TownyPlayerListener, this);
+ pm.registerEvents(heroicDeathListener, this);
}
@@ -164,4 +185,8 @@ public class Chat extends JavaPlugin {
return towny;
}
+ public HeroicDeathForwarder getHeroicDeath() {
+ return heroicDeathListener;
+ }
+
}
\ No newline at end of file
diff --git a/src/plugin.yml b/src/plugin.yml
index 82a7566..920ab7a 100644
--- a/src/plugin.yml
+++ b/src/plugin.yml
@@ -1,6 +1,6 @@
name: TownyChat
main: com.palmergames.bukkit.TownyChat.Chat
-version: 0.17
+version: 0.18
author: ElgarL, Shade
website: http://code.google.com/a/eclipselabs.org/p/towny/
description: >