+ (pose_loc != null ? pose_loc.debug() : ""));
if (!npc.getCitizen().hasTrait(Poses.class))
npc.getCitizen().addTrait(Poses.class);
Poses poses = npc.getCitizen().getTrait(Poses.class);
switch (action) {
case ASSUME:
if (!poses.hasPose(id))
throw new CommandExecutionException("Pose \"" + id + "\" doesn't exist for " + npc.toString());
if (target.name().equals("NPC"))
poses.assumePose(id);
else {
Player player = ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getPlayerEntity();
Location location = player.getLocation();
location.setYaw(poses.getPose(id).getYaw());
location.setPitch(poses.getPose(id).getPitch());
// The only way to change a player's yaw and pitch in Bukkit
// is to use teleport on him/her
player.teleport(location);
}
break;
case ADD:
if (!poses.addPose(id, pose_loc))
throw new CommandExecutionException(npc.toString() + " already has that pose!");
break;
case REMOVE:
if (!poses.removePose(id))
throw new CommandExecutionException(npc.toString() + " does not have that pose!");
break;
}