Remove old Essentials chat integration features.

This commit is contained in:
Olof Larsson
2013-04-09 13:02:40 +02:00
parent c88847bd3e
commit f119fbb6f6
3 changed files with 1 additions and 96 deletions

View File

@ -59,27 +59,15 @@ public class EssentialsFeatures
}
catch (ClassNotFoundException ex)
{
// no? try older Essentials 2.x integration method
try
{
EssentialsOldVersionFeatures.integrateChat(essChat);
}
catch (NoClassDefFoundError ex2) { /* no known integration method, then */ }
}
}
public static void unhookChat()
{
if (essChat == null) return;
try
{
EssentialsOldVersionFeatures.unhookChat();
}
catch (NoClassDefFoundError ex) {}
}
// return false if feature is disabled or Essentials isn't available
public static boolean handleTeleport(Player player, Location loc)
{

View File

@ -1,53 +0,0 @@
package com.massivecraft.factions.integration;
import org.bukkit.entity.Player;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.listeners.FactionsChatListener;
import com.earth2me.essentials.chat.EssentialsChat;
import com.earth2me.essentials.chat.IEssentialsChatListener;
/*
* This Essentials integration handler is for older 2.x.x versions of Essentials which have "IEssentialsChatListener"
*/
public class EssentialsOldVersionFeatures
{
private static EssentialsChat essChat;
public static void integrateChat(EssentialsChat instance)
{
essChat = instance;
try
{
essChat.addEssentialsChatListener("Factions", new IEssentialsChatListener()
{
public boolean shouldHandleThisChat(AsyncPlayerChatEvent event)
{
return Factions.p.shouldLetFactionsHandleThisChat(event);
}
public String modifyMessage(AsyncPlayerChatEvent event, Player target, String message)
{
return FactionsChatListener.parseTags(message, event.getPlayer(), target);
//return message.replace(Conf.chatTagReplaceString, P.p.getPlayerFactionTagRelation(event.getPlayer(), target)).replace("[FACTION_TITLE]", P.p.getPlayerTitle(event.getPlayer()));
}
});
Factions.p.log("Found and will integrate chat with "+essChat.getDescription().getFullName());
}
catch (NoSuchMethodError ex)
{
essChat = null;
}
}
public static void unhookChat()
{
if (essChat != null)
{
essChat.removeEssentialsChatListener("Factions");
}
}
}