Update master

This commit is contained in:
fullwall 2012-06-10 16:06:45 +08:00
parent e28e06ea2a
commit dfdce9e4b6

View File

@ -323,17 +323,17 @@ public class NPCCommands {
npc.spawn(npc.getTrait(CurrentLocation.class).getLocation()); npc.spawn(npc.getTrait(CurrentLocation.class).getLocation());
Location current = npc.getBukkitEntity().getLocation(); Location current = npc.getBukkitEntity().getLocation();
Location to = current.clone(); Location to = current.clone();
if (args.hasFlag("x")) if (args.hasValueFlag("x"))
to.setX(args.getFlagInteger("x")); to.setX(args.getFlagInteger("x"));
if (args.hasFlag("y")) if (args.hasValueFlag("y"))
to.setY(args.getFlagInteger("y")); to.setY(args.getFlagInteger("y"));
if (args.hasFlag("z")) if (args.hasValueFlag("z"))
to.setZ(args.getFlagInteger("z")); to.setZ(args.getFlagInteger("z"));
if (args.hasFlag("yaw")) if (args.hasValueFlag("yaw"))
to.setYaw((float) args.getFlagDouble("yaw")); to.setYaw((float) args.getFlagDouble("yaw"));
if (args.hasFlag("pitch")) if (args.hasValueFlag("pitch"))
to.setPitch((float) args.getFlagDouble("pitch")); to.setPitch((float) args.getFlagDouble("pitch"));
if (args.hasFlag("world")){ if (args.hasValueFlag("world")){
World world = Bukkit.getWorld(args.getFlag("world")); World world = Bukkit.getWorld(args.getFlag("world"));
if (world == null) if (world == null)
throw new CommandException("Given world not found."); throw new CommandException("Given world not found.");