summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-07-27 17:20:16 -0700
committerKHobbits <rob@khobbits.co.uk>2011-07-27 17:20:16 -0700
commitc2995ca9063a438b131d3c5e019718f6dff92258 (patch)
treea1d250146fc70314ea0a122ca0bea437d5e3208d
parent2f8f5bf1fc33115766889b9221b29123e2946aef (diff)
parent4c610d2a02c3f9a7addf3c86386f8c5214b72d4d (diff)
downloadEssentials-c2995ca9063a438b131d3c5e019718f6dff92258.tar
Essentials-c2995ca9063a438b131d3c5e019718f6dff92258.tar.gz
Essentials-c2995ca9063a438b131d3c5e019718f6dff92258.tar.lz
Essentials-c2995ca9063a438b131d3c5e019718f6dff92258.tar.xz
Essentials-c2995ca9063a438b131d3c5e019718f6dff92258.zip
Merge pull request #21 from khobbits/master
rainbow sheep
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index a2af502ee..86d2beac4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -7,6 +7,7 @@ import com.earth2me.essentials.Mob;
import com.earth2me.essentials.Mob.MobException;
import com.earth2me.essentials.TargetBlock;
import com.earth2me.essentials.Util;
+import java.util.Random;
import net.minecraft.server.EntityWolf;
import net.minecraft.server.PathEntity;
import org.bukkit.DyeColor;
@@ -207,7 +208,15 @@ public class Commandspawnmob extends EssentialsCommand
{
try
{
- ((CraftSheep)spawned).setColor(DyeColor.valueOf(data.toUpperCase()));
+ if (data.equalsIgnoreCase("random"))
+ {
+ Random rand = new Random();
+ ((CraftSheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
+ }
+ else
+ {
+ ((CraftSheep)spawned).setColor(DyeColor.valueOf(data.toUpperCase()));
+ }
}
catch (Exception e)
{