summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-04 21:54:51 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-05 08:37:14 +0000
commit15c0565923cf521daa8af3dac10aed6b38133c98 (patch)
tree2d86486f09dd4204a5537b7b17a03742e35822a3
parent2b25ca2932d9a0d72f4651cf77a8895045f97a98 (diff)
downloadEssentials-15c0565923cf521daa8af3dac10aed6b38133c98.tar
Essentials-15c0565923cf521daa8af3dac10aed6b38133c98.tar.gz
Essentials-15c0565923cf521daa8af3dac10aed6b38133c98.tar.lz
Essentials-15c0565923cf521daa8af3dac10aed6b38133c98.tar.xz
Essentials-15c0565923cf521daa8af3dac10aed6b38133c98.zip
Build custom mob list /spawnmob
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java13
1 files 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<String> availableList = Mob.getMobList();
- for (String mob : availableList)
+ final Set<String> mobList = Mob.getMobList();
+ 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())