Preemptive EssentialsChat 3.x support, since they'll be removing the old local chat integration method; new implementation will need improvement to support relation coloring, but for now it otherwise works.
When chat event hits an UnknownFormatConversionException which requires better chat configuration, the quick dirty fix of setting chatTagInsertIndex to 0 is now automatically applied.
This commit is contained in:
@@ -21,7 +21,10 @@ import com.massivecraft.factions.adapters.FPermTypeAdapter;
|
||||
import com.massivecraft.factions.adapters.LocationTypeAdapter;
|
||||
import com.massivecraft.factions.adapters.RelTypeAdapter;
|
||||
import com.massivecraft.factions.cmd.*;
|
||||
import com.massivecraft.factions.integration.capi.CapiFeatures;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.integration.EssentialsFeatures;
|
||||
import com.massivecraft.factions.integration.EssentialsOldVersionFeatures;
|
||||
import com.massivecraft.factions.integration.LWCFeatures;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
//import com.massivecraft.factions.integration.Worldguard;
|
||||
@@ -40,8 +43,6 @@ import com.griefcraft.lwc.LWCPlugin;
|
||||
import com.earth2me.essentials.chat.EssentialsChat;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.massivecraft.factions.integration.EssentialsFeatures;
|
||||
import com.massivecraft.factions.integration.capi.CapiFeatures;
|
||||
|
||||
|
||||
public class P extends MPlugin
|
||||
@@ -184,7 +185,25 @@ public class P extends MPlugin
|
||||
if (test != null && test.isEnabled())
|
||||
{
|
||||
essChat = (EssentialsChat)test;
|
||||
EssentialsFeatures.integrateChat(essChat);
|
||||
|
||||
// try newer Essentials 3.x integration method
|
||||
try
|
||||
{
|
||||
Class.forName("com.earth2me.essentials.chat.EssentialsLocalChatEvent");
|
||||
EssentialsFeatures.integrateChat(essChat);
|
||||
}
|
||||
catch (ClassNotFoundException ex)
|
||||
{
|
||||
// no? try older Essentials 2.x integration method
|
||||
try
|
||||
{
|
||||
EssentialsOldVersionFeatures.integrateChat(essChat);
|
||||
}
|
||||
catch (NoClassDefFoundError ex2)
|
||||
{
|
||||
// no known method for hooking into Essentials chat stuff
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +211,13 @@ public class P extends MPlugin
|
||||
{
|
||||
if (essChat != null)
|
||||
{
|
||||
EssentialsFeatures.unhookChat();
|
||||
try
|
||||
{
|
||||
EssentialsOldVersionFeatures.unhookChat();
|
||||
}
|
||||
catch (NoClassDefFoundError ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user