This commit is contained in:
ZeroEpoch1969
2018-12-29 12:41:48 -07:00
parent 7a43f991e3
commit 72db71b3cf
16 changed files with 187 additions and 61 deletions

View File

@ -1,6 +1,6 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.libsdisguise.DisallowedDisguises;
import me.totalfreedom.disguise.DisguiseBlocker;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.command.Command;
@ -8,7 +8,7 @@ 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")
@CommandParameters(description = "Undisguise all players on the server", usage = "/<command> [-a]", aliases = "uall")
public class Command_undisguiseall extends FreedomCommand
{
@ -21,15 +21,22 @@ public class Command_undisguiseall extends FreedomCommand
return true;
}
if (DisallowedDisguises.disabled)
if (!DisguiseBlocker.enabled)
{
msg("Disguises are not enabled.");
return true;
}
FUtil.adminAction(sender.getName(), "Undisguising all non-admins", true);
boolean admins = false;
plugin.ldb.undisguiseAll(false);
if (args.length > 0 && args[0].equalsIgnoreCase("-a"))
{
admins = true;
}
FUtil.adminAction(sender.getName(), "Undisguising all " + (admins ? "players" : "non-admins"), true);
plugin.ldb.undisguiseAll(admins);
return true;
}