Remove spout features, add worldguard and worldedit.
This commit is contained in:
@@ -4,16 +4,12 @@ import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.Teleport;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.chat.EssentialsChat;
|
||||
import com.earth2me.essentials.chat.EssentialsLocalChatEvent;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.P;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
@@ -50,20 +46,11 @@ public class EssentialsFeatures {
|
||||
Class.forName("com.earth2me.essentials.chat.EssentialsLocalChatEvent");
|
||||
integrateChat(essChat);
|
||||
} 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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +72,6 @@ public class EssentialsFeatures {
|
||||
public static void integrateChat(EssentialsChat instance) {
|
||||
essChat = instance;
|
||||
try {
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new LocalChatListener(), P.p);
|
||||
P.p.log("Found and will integrate chat with newer " + essChat.getDescription().getFullName());
|
||||
|
||||
// curly braces used to be accepted by the format string EssentialsChat but no longer are, so... deal with chatTagReplaceString which might need updating
|
||||
@@ -97,17 +83,4 @@ public class EssentialsFeatures {
|
||||
essChat = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static class LocalChatListener implements Listener {
|
||||
@SuppressWarnings("unused")
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerChat(EssentialsLocalChatEvent event) {
|
||||
Player speaker = event.getPlayer();
|
||||
String format = event.getFormat();
|
||||
format = format.replace(Conf.chatTagReplaceString, P.p.getPlayerFactionTag(speaker)).replace("[FACTION_TITLE]", P.p.getPlayerTitle(speaker));
|
||||
event.setFormat(format);
|
||||
// NOTE: above doesn't do relation coloring. if/when we can get a local recipient list from EssentialsLocalChatEvent, we'll probably
|
||||
// want to pass it on to FactionsPlayerListener.onPlayerChat(PlayerChatEvent event) rather than duplicating code
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user