2011-10-19 00:37:00 +00:00
|
|
|
package me.StevenLawson.TotalFreedomMod.Commands;
|
|
|
|
|
|
|
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.World;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.*;
|
|
|
|
|
|
|
|
public class Command_mp extends TFM_Command
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
if (senderIsConsole || sender.isOp())
|
|
|
|
{
|
|
|
|
sender.sendMessage(ChatColor.GRAY + "Purging all mobs...");
|
|
|
|
|
|
|
|
int removed = 0;
|
2012-03-06 19:25:22 +00:00
|
|
|
for (World world : server.getWorlds())
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
2011-11-21 05:54:11 +00:00
|
|
|
for (Entity ent : world.getLivingEntities())
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
2012-11-18 03:57:24 +00:00
|
|
|
if (ent instanceof Creature || ent instanceof Ghast || ent instanceof Slime || ent instanceof EnderDragon || ent instanceof Ambient)
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
|
|
|
ent.remove();
|
|
|
|
removed++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sender.sendMessage(ChatColor.GRAY + String.valueOf(removed) + " mobs removed.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|