public void disable_cmd() throws CivException { Player player = getPlayer(); String name = getNamedString(1, "Enter a mob name"); switch (name.toLowerCase()) { case "yobo": CommonCustomMob.disabledMobs.add(CustomMobType.YOBO.toString()); break; case "angryyobo": CommonCustomMob.disabledMobs.add(CustomMobType.ANGRYYOBO.toString()); break; case "savage": CommonCustomMob.disabledMobs.add(CustomMobType.SAVAGE.toString()); break; case "ruffian": CommonCustomMob.disabledMobs.add(CustomMobType.RUFFIAN.toString()); break; case "behemoth": CommonCustomMob.disabledMobs.add(CustomMobType.BEHEMOTH.toString()); break; default: throw new CivException("Invalid mob. Make sure it is spelled right!"); } CivMessage.sendSuccess(player, "Disabled " + name); }
public void killall_cmd() throws CivException { Player player = getPlayer(); String name = getNamedString(1, "Enter a mob name"); LinkedList<CommonCustomMob> removeUs = new LinkedList<CommonCustomMob>(); for (CommonCustomMob mob : CommonCustomMob.customMobs.values()) { if (mob.getType().toString().equalsIgnoreCase(name)) { removeUs.add(mob); } } int count = 0; for (CommonCustomMob mob : removeUs) { CommonCustomMob.customMobs.remove(mob.entity.getUniqueID()); mob.entity.getBukkitEntity().remove(); count++; } CivMessage.sendSuccess(player, "Removed " + count + " mobs of type " + name); }