/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.scape.Drone; /* */ import NET.worlds.scape.HoloPilot; /* */ import NET.worlds.scape.Pilot; /* */ import NET.worlds.scape.Point3Temp; /* */ import NET.worlds.scape.TeleportAction; /* */ import NET.worlds.scape.TeleportStatus; /* */ import java.io.DataInputStream; /* */ import java.io.DataOutputStream; /* */ import java.io.IOException; /* */ /* */ /* */ /* */ /* */ public class BBTeleportCommand /* */ extends BlackBoxCommand /* */ implements TeleportStatus /* */ { /* */ private String location; /* */ /* */ public BBTeleportCommand() /* */ { /* 24 */ this.commandType = 1; /* */ } /* */ /* */ public BBTeleportCommand(String pLocation) { /* 28 */ this(); /* 29 */ if (pLocation != null) { /* 30 */ this.location = new String(pLocation); /* */ } /* */ } /* */ /* */ public boolean execute() { /* 35 */ if (this.location != null) /* 36 */ TeleportAction.teleport(this.location, this); /* 37 */ return true; /* */ } /* */ /* */ public void save(DataOutputStream dos) throws IOException /* */ { /* 42 */ super.save(dos); /* 43 */ if (this.location == null) { /* 44 */ dos.writeUTF(""); /* */ } else { /* 46 */ dos.writeUTF(this.location); /* */ } /* */ } /* */ /* */ public void load(DataInputStream dis) throws IOException { /* 51 */ super.load(dis); /* 52 */ this.location = dis.readUTF(); /* 53 */ if (this.location.equals("")) { /* 54 */ this.location = null; /* */ } /* */ } /* */ /* */ public void teleportStatus(String err, String targetURL) { /* 59 */ Pilot p = Pilot.getActive(); /* 60 */ if ((p instanceof HoloPilot)) { /* 61 */ HoloPilot hp = (HoloPilot)p; /* 62 */ Drone d = hp.getInternalDrone(); /* 63 */ if (d != null) { /* 64 */ short dir = (short)(int)(-p.getYaw() + 90.0F); /* 65 */ dir = (short)(dir % 360); /* 66 */ while (dir < 0) { /* 67 */ dir = (short)(dir + 360); /* */ } /* 69 */ dir = (short)(90 - dir); /* 70 */ dir = (short)(360 - dir); /* */ /* 72 */ Point3Temp pos = p.getPosition(); /* 73 */ d.reset((short)(int)pos.x, (short)(int)pos.y, /* 74 */ (short)(int)p.getFootHeight(), dir); /* */ } /* */ } /* */ /* 78 */ if (err == null) { /* 79 */ doCallback(true); /* */ } else { /* 81 */ doCallback(false); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\BBTeleportCommand.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */