mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-03 14:38:56 +00:00
Fix a duplicating chat issue when relaying via craftIRC.
This commit is contained in:
1 parent
9c1858320b
commit
6c8f030d49
4 files changed
+46
-21
No files matched your search
@@ -80,15 +80,20 @@ public class Chat extends JavaPlugin {
|
||||
public void onDisable() {
|
||||
unregisterPermissions();
|
||||
// reset any handles
|
||||
irc = null;
|
||||
|
||||
if (craftIRC != null) {
|
||||
craftIRC.unregisterEndPoint("towny");
|
||||
craftIRC = null;
|
||||
}
|
||||
irc = null;
|
||||
|
||||
dynMap = null;
|
||||
heroicDeathListener= null;
|
||||
towny = null;
|
||||
pm = null;
|
||||
|
||||
configuration = null;
|
||||
channels = null;
|
||||
}
|
||||
|
||||
private void checkPlugins() {
|
||||
@@ -105,7 +110,7 @@ public class Chat extends JavaPlugin {
|
||||
try {
|
||||
if (Double.valueOf(test.getDescription().getVersion()) >= 3.1) {
|
||||
craftIRC = (CraftIRC) test;
|
||||
irc = new CraftIRCHandler(towny, craftIRC, "towny");
|
||||
irc = new CraftIRCHandler(craftIRC, "towny");
|
||||
} else
|
||||
getLogger().warning("TownyChat requires CraftIRC version 3.1 or higher to relay chat.");
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -132,12 +137,15 @@ public class Chat extends JavaPlugin {
|
||||
}
|
||||
|
||||
public void registerEvents() {
|
||||
TownyPlayerListener = new TownyChatPlayerListener(this);
|
||||
|
||||
if (TownyPlayerListener != null)
|
||||
pm.registerEvents(TownyPlayerListener, this);
|
||||
if (heroicDeathListener != null)
|
||||
pm.registerEvents(heroicDeathListener, this);
|
||||
|
||||
if (TownyPlayerListener == null) {
|
||||
TownyPlayerListener = new TownyChatPlayerListener(this);
|
||||
|
||||
if (TownyPlayerListener != null)
|
||||
pm.registerEvents(TownyPlayerListener, this);
|
||||
if (heroicDeathListener != null)
|
||||
pm.registerEvents(heroicDeathListener, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user