@Override
 public void repaint(Graphics g) {
   if (startTile != null && rope != null) {
     startTile.matrix(ctx).draw(g);
     rope.draw(g);
   }
 }
Example #2
0
 public boolean teleport(final ClientContext ctx, boolean key) {
   final TileMatrix lodestoneMatrix = location.matrix(ctx);
   if (lodestoneMatrix.onMap() && lodestoneMatrix.reachable()) {
     ctx.movement.step(lodestoneMatrix);
   } else if (!teleporting(ctx) || wrongDest) {
     if (componentPresent(
         ctx.widgets.component(TELEPORT_INTERFACE_WIDGET, TELEPORT_INTERFACE_COMPONENT))) {
       final Component dest = ctx.widgets.component(1092, this.widgetIndex());
       if (key && ctx.input.send(this.key)
           || ctx.input.click(dest.nextPoint(), true) && clickedCorrect(ctx, dest)) {
         wrongDest = false;
         Condition.wait(
             new Callable<Boolean>() {
               @Override
               public Boolean call() throws Exception {
                 return teleporting(ctx);
               }
             },
             100,
             25);
       } else {
         wrongDest = true;
       }
     } else {
       if (ctx.input.click(
           ctx.widgets.component(MINIMAP_WIDGET, OPEN_INTERFACE_COMPONENT).nextPoint(), true)) {
         Condition.wait(
             new Callable<Boolean>() {
               @Override
               public Boolean call() throws Exception {
                 return componentPresent(
                     ctx.widgets.component(
                         TELEPORT_INTERFACE_WIDGET, TELEPORT_INTERFACE_COMPONENT));
               }
             },
             100,
             23);
       }
     }
   }
   return ctx.players.local().tile().distanceTo(location) <= 6 && !teleporting(ctx);
 }