mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 21:43:54 +00:00
Readd /uall and /dtoggle. Resolves #1793
This commit is contained in:
@ -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 = "/<command>", 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;
|
||||
}
|
||||
}
|
@ -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 = "/<command>", 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user