Remove spout features, add worldguard and worldedit.

This commit is contained in:
drtshock
2014-04-05 15:42:01 -05:00
parent d9b7cf7058
commit c4f7d6b756
15 changed files with 47 additions and 214 deletions

View File

@@ -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
}
}
}