diff --git a/pom.xml b/pom.xml
index 559c3e9a..b35d71b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,6 +96,14 @@
system
${project.basedir}/lib/TF-Essentials-2.1.jar
+
+
+ me.libaryaddict.disguise
+ LibsDisguises
+ 9.0.9
+ system
+ ${project.basedir}/lib/LibsDisguises-9.0.9.jar
+
diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
index f52ef220..38bd7f45 100644
--- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
+++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
@@ -16,6 +16,7 @@ import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
import me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker;
import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge;
import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
+import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge;
import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge;
import me.totalfreedom.totalfreedommod.caging.Cager;
import me.totalfreedom.totalfreedommod.command.CommandLoader;
@@ -101,6 +102,7 @@ public class TotalFreedomMod extends AeroPlugin
public ServiceManager bridges;
public BukkitTelnetBridge btb;
public EssentialsBridge esb;
+ public LibsDisguisesBridge ldb;
public WorldEditBridge web;
@Override
@@ -201,6 +203,7 @@ public class TotalFreedomMod extends AeroPlugin
bridges = new ServiceManager<>(plugin);
btb = bridges.registerService(BukkitTelnetBridge.class);
esb = bridges.registerService(EssentialsBridge.class);
+ ldb = bridges.registerService(LibsDisguisesBridge.class);
web = bridges.registerService(WorldEditBridge.class);
bridges.start();
diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java
new file mode 100644
index 00000000..4c05e3e4
--- /dev/null
+++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java
@@ -0,0 +1,133 @@
+package me.totalfreedom.totalfreedommod.bridge;
+
+import me.libraryaddict.disguise.LibsDisguises;
+import me.libraryaddict.disguise.DisguiseAPI;
+import me.totalfreedom.totalfreedommod.FreedomService;
+import me.totalfreedom.totalfreedommod.TotalFreedomMod;
+import me.totalfreedom.totalfreedommod.util.FLog;
+import org.bukkit.entity.Player;
+import org.bukkit.Bukkit;
+import org.bukkit.plugin.Plugin;
+
+public class LibsDisguisesBridge extends FreedomService
+{
+
+ private LibsDisguises libsDisguisesPlugin = null;
+
+ public LibsDisguisesBridge(TotalFreedomMod plugin)
+ {
+ super(plugin);
+ }
+
+ @Override
+ protected void onStart()
+ {
+ }
+
+ @Override
+ protected void onStop()
+ {
+ }
+
+ public LibsDisguises getLibsDisguisesPlugin()
+ {
+ if (libsDisguisesPlugin == null)
+ {
+ try
+ {
+ final Plugin libsDisguises = server.getPluginManager().getPlugin("LibsDisguises");
+ if (libsDisguises != null)
+ {
+ if (libsDisguises instanceof LibsDisguises)
+ {
+ libsDisguisesPlugin = (LibsDisguises) libsDisguises;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ FLog.severe(ex);
+ }
+ }
+ return libsDisguisesPlugin;
+ }
+
+ public Boolean isDisguised(Player player)
+ {
+ try
+ {
+ final LibsDisguises libsDisguises = getLibsDisguisesPlugin();
+ if (libsDisguises != null)
+ {
+ return DisguiseAPI.isDisguised(player);
+ }
+ }
+ catch (Exception ex)
+ {
+ FLog.severe(ex);
+ }
+ return null;
+ }
+
+ public void undisguiseAll(boolean admins)
+ {
+ try
+ {
+ final LibsDisguises libsDisguises = getLibsDisguisesPlugin();
+
+ if (libsDisguises == null)
+ {
+ return;
+ }
+
+ for (Player player : server.getOnlinePlayers())
+ {
+ if (DisguiseAPI.isDisguised(player))
+ {
+ if (!admins && plugin.al.isAdmin(player))
+ {
+ continue;
+ }
+ DisguiseAPI.undisguiseToAll(player);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ FLog.severe(ex);
+ }
+ }
+
+ public boolean setPluginEnabled(boolean enabled)
+ {
+ Plugin ld = getLibsDisguisesPlugin();
+
+ if (ld == null)
+ {
+ return false;
+ }
+
+ if (enabled)
+ {
+ server.getPluginManager().enablePlugin(ld);
+ }
+ else
+ {
+ server.getPluginManager().disablePlugin(ld);
+ }
+
+ return true;
+ }
+
+ public boolean isPluginEnabled()
+ {
+ Plugin ld = getLibsDisguisesPlugin();
+
+ if (ld == null)
+ {
+ return false;
+ }
+
+ return ld.isEnabled();
+ }
+}
diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java
new file mode 100644
index 00000000..5fec36f8
--- /dev/null
+++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java
@@ -0,0 +1,37 @@
+package me.totalfreedom.totalfreedommod.command;
+
+import me.totalfreedom.totalfreedommod.rank.Rank;
+import me.totalfreedom.totalfreedommod.util.FUtil;
+import org.bukkit.command.Command;
+import org.bukkit.ChatColor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
+@CommandParameters(description = "Toggle the disguise plugin", usage = "/", aliases = "dtoggle")
+public class Command_disguisetoggle extends FreedomCommand
+{
+
+ @Override
+ public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
+ {
+ if (plugin.ldb.getLibsDisguisesPlugin() == null)
+ {
+ msg(ChatColor.RED + "LibsDisguises is not enabled.");
+ return true;
+ }
+
+ boolean newState = !plugin.ldb.isPluginEnabled();
+ FUtil.adminAction(sender.getName(), (newState ? "Enabling" : "Disabling") + " disguises", false);
+
+ if (!newState)
+ {
+ plugin.ldb.undisguiseAll(true);
+ }
+ plugin.ldb.setPluginEnabled(newState);
+
+ msg("Disguises are now " + (newState ? "enabled." : "disabled."));
+
+ return true;
+ }
+}
diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java
new file mode 100644
index 00000000..f0123d5a
--- /dev/null
+++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java
@@ -0,0 +1,36 @@
+package me.totalfreedom.totalfreedommod.command;
+
+import me.libraryaddict.disguise.DisallowedDisguises;
+import me.totalfreedom.totalfreedommod.rank.Rank;
+import me.totalfreedom.totalfreedommod.util.FUtil;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
+@CommandParameters(description = "Undisguise all players on the server", usage = "/", aliases = "uall")
+public class Command_undisguiseall extends FreedomCommand
+{
+
+ @Override
+ public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
+ {
+ if (!plugin.ldb.isPluginEnabled())
+ {
+ msg("LibsDisguises is not enabled.");
+ return true;
+ }
+
+ if (DisallowedDisguises.disabled)
+ {
+ msg("Disguises are not enabled.");
+ return true;
+ }
+
+ FUtil.adminAction(sender.getName(), "Undisguising all non-admins", true);
+
+ plugin.ldb.undisguiseAll(false);
+
+ return true;
+ }
+}
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index f5081a43..cebffe6a 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -3,7 +3,7 @@ main: me.totalfreedom.totalfreedommod.TotalFreedomMod
version: ${tfm.build.version}
description: Plugin for the Total Freedom server.
depend: [Aero, WorldEdit]
-softdepend: [BukkitTelnet, Essentials]
+softdepend: [BukkitTelnet, Essentials, LibsDisguises]
authors: [Madgeek1450, Prozza]
# plugin.yml is no longer used to define commands.