Made /rd simpler

This commit is contained in:
Jerom van der Sar 2012-09-17 21:57:52 +02:00
parent 92110f78c4
commit 013dd1d2cc

View File

@ -13,26 +13,13 @@ public class Command_rd extends TFM_Command
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (senderIsConsole || sender.isOp())
{
if (args.length == 1)
{
if (Arrays.asList("minecart", "minecarts", "cart", "carts").contains(args[0].toLowerCase()))
{
sender.sendMessage(ChatColor.GRAY + "Removing all projectiles, dropped items, exp. orbs, primed explosives, and minecarts.");
sender.sendMessage(ChatColor.GRAY + String.valueOf(TFM_Util.wipeEntities(true, true)) + " enties removed.");
}
}
else
{
sender.sendMessage(ChatColor.GRAY + "Removing all projectiles, dropped items, exp. orbs and primed explosives.");
sender.sendMessage(ChatColor.GRAY + String.valueOf(TFM_Util.wipeEntities(true)) + " enties removed.");
}
}
else
if (!(senderIsConsole || TFM_Util.isUserSuperadmin(sender)))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
TFM_Util.adminAction(sender.getName(), "Removing all server entities", false);
sender.sendMessage(ChatColor.GRAY + String.valueOf(TFM_Util.wipeEntities(true, true)) + " enties removed.");
return true;
}