From 15c0565923cf521daa8af3dac10aed6b38133c98 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 21:54:51 +0000 Subject: Build custom mob list /spawnmob --- .../com/earth2me/essentials/commands/Commandspawnmob.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 5c0dc84fe..97141e585 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob.MobException; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -import java.util.Locale; -import java.util.Random; -import java.util.Set; +import java.util.*; import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Server; @@ -27,12 +25,13 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - final Set availableList = Mob.getMobList(); - for (String mob : availableList) + final Set mobList = Mob.getMobList(); + final Set availableList = new HashSet(); + 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()) -- cgit v1.2.3