From e5be12bc5c7023d423eea288c2008bfbfa0e366f Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 3 Apr 2011 16:32:33 +0000 Subject: [PATCH] [trunk] Fixes slime:size 1 is smallest Also added wool color for sheeps: Use color name (like white, red, blue) Example: /spawnmob sheep:blue git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1104 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../essentials/commands/Commandspawnmob.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 51c114147..f07dc42d7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -9,6 +9,10 @@ import com.earth2me.essentials.User; import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob.MobException; import com.earth2me.essentials.TargetBlock; +import net.minecraft.server.EntitySheep; +import org.bukkit.DyeColor; +import org.bukkit.craftbukkit.entity.CraftSheep; +import org.bukkit.craftbukkit.entity.CraftSlime; public class Commandspawnmob extends EssentialsCommand @@ -102,7 +106,7 @@ public class Commandspawnmob extends EssentialsCommand { try { - //((EntitySlime)spawned.getHandle()).a(Integer.parseInt(split1[1])); + ((CraftSlime)spawned).setSize(Integer.parseInt(split1[1])); } catch (Exception e) { @@ -110,6 +114,18 @@ public class Commandspawnmob extends EssentialsCommand return; } } + if (split1.length == 2 && "Sheep".equals(mob.name)) + { + try + { + ((CraftSheep)spawned).setColor(DyeColor.valueOf(split1[1].toUpperCase())); + } + catch (Exception e) + { + user.sendMessage("Malformed color."); + return; + } + } if (args.length == 2) { int mobCount = Integer.parseInt(args[1]);