Well, this is an odd and kludgy fix... only thing I can find that allows the integration to work correctly and not give an error whether EssentialsChat is present or not
This commit is contained in:
parent
b650387dbc
commit
bd5d7e185e
@ -0,0 +1,12 @@
|
|||||||
|
package com.earth2me.essentials.chat;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IEssentialsChatListener
|
||||||
|
{
|
||||||
|
boolean shouldHandleThisChat(PlayerChatEvent event);
|
||||||
|
|
||||||
|
String modifyMessage(PlayerChatEvent event, Player target, String message);
|
||||||
|
}
|
@ -192,6 +192,7 @@ public class Factions extends JavaPlugin {
|
|||||||
Plugin test = this.getServer().getPluginManager().getPlugin("EssentialsChat");
|
Plugin test = this.getServer().getPluginManager().getPlugin("EssentialsChat");
|
||||||
|
|
||||||
if (test != null) {
|
if (test != null) {
|
||||||
|
try {
|
||||||
essChat = (EssentialsChat)test;
|
essChat = (EssentialsChat)test;
|
||||||
essChat.addEssentialsChatListener("Factions", new IEssentialsChatListener() {
|
essChat.addEssentialsChatListener("Factions", new IEssentialsChatListener() {
|
||||||
public boolean shouldHandleThisChat(PlayerChatEvent event)
|
public boolean shouldHandleThisChat(PlayerChatEvent event)
|
||||||
@ -205,6 +206,10 @@ public class Factions extends JavaPlugin {
|
|||||||
});
|
});
|
||||||
Factions.log("Found and will integrate chat with "+test.getDescription().getFullName());
|
Factions.log("Found and will integrate chat with "+test.getDescription().getFullName());
|
||||||
}
|
}
|
||||||
|
catch (NoSuchMethodError ex) {
|
||||||
|
essChat = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void unhookEssentialsChat() {
|
private void unhookEssentialsChat() {
|
||||||
if (essChat != null) {
|
if (essChat != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user