Build custom mob list /spawnmob

This commit is contained in:
KHobbits 2012-03-04 21:54:51 +00:00
parent 2b25ca2932
commit 15c0565923

View File

@ -5,9 +5,7 @@ import com.earth2me.essentials.Mob;
import com.earth2me.essentials.Mob.MobException; import com.earth2me.essentials.Mob.MobException;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.Util; import com.earth2me.essentials.Util;
import java.util.Locale; import java.util.*;
import java.util.Random;
import java.util.Set;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
@ -27,12 +25,13 @@ public class Commandspawnmob extends EssentialsCommand
{ {
if (args.length < 1) if (args.length < 1)
{ {
final Set<String> availableList = Mob.getMobList(); final Set<String> mobList = Mob.getMobList();
for (String mob : availableList) final Set<String> availableList = new HashSet<String>();
for (String mob : mobList)
{ {
if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase()))
{ {
availableList.remove(mob); availableList.add(mob);
} }
} }
if (availableList.isEmpty()) if (availableList.isEmpty())