[trunk] Spawn angry or tamed wolf

/spawnmob wolf:angry
/spawnmob wolf:tamed

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1105 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-03 17:10:19 +00:00
parent e5be12bc5c
commit 05c902371a

View file

@ -10,9 +10,12 @@ import com.earth2me.essentials.Mob;
import com.earth2me.essentials.Mob.MobException;
import com.earth2me.essentials.TargetBlock;
import net.minecraft.server.EntitySheep;
import net.minecraft.server.EntityWolf;
import net.minecraft.server.PathEntity;
import org.bukkit.DyeColor;
import org.bukkit.craftbukkit.entity.CraftSheep;
import org.bukkit.craftbukkit.entity.CraftSlime;
import org.bukkit.craftbukkit.entity.CraftWolf;
public class Commandspawnmob extends EssentialsCommand
@ -126,6 +129,20 @@ public class Commandspawnmob extends EssentialsCommand
return;
}
}
if (split1.length == 2 && "Wolf".equals(mob.name) && split1[1].equalsIgnoreCase("tamed"))
{
EntityWolf wolf = ((CraftWolf)spawned).getHandle();
wolf.d(true);
wolf.a((PathEntity) null);
wolf.b(true);
wolf.health = 20;
wolf.a(user.getName());
wolf.world.a(wolf, (byte) 7);
}
if (split1.length == 2 && "Wolf".equals(mob.name) && split1[1].equalsIgnoreCase("angry"))
{
((CraftWolf)spawned).setAngry(true);
}
if (args.length == 2)
{
int mobCount = Integer.parseInt(args[1]);