Package org.moparscape.msc.gs.event

Examples of org.moparscape.msc.gs.event.DelayedEvent


  public void setFollowing(final Mob mob, final int radius) {
    if (isFollowing()) {
      resetFollowing();
    }
    following = mob;
    followEvent = new DelayedEvent(this, 500) {

      public void run() {
        if (!owner.withinRange(mob) || mob.isRemoved()
            || (owner.isBusy() && !owner.isDueling())) {
          resetFollowing();
View Full Code Here


        events.addAll(toAdd);
        toAdd.clear();
      }
      Iterator<DelayedEvent> iterator = events.iterator();
      while (iterator.hasNext()) {
        DelayedEvent event = iterator.next();

        if (event == null) {
          iterator.remove();
          continue;
        }

        if (event.shouldRun()) {
          event.run();
          event.updateLastRun();
        }
        if (event.shouldRemove()) {
          iterator.remove();
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public void removePlayersEvents(Player player) {
    try {
      Iterator<DelayedEvent> iterator = events.iterator();
      while (iterator.hasNext()) {
        DelayedEvent event = iterator.next();
        if (event.belongsTo(player)) {
          iterator.remove();
        }
      }
    } catch (Exception e) {
      Logger.println("Error @ removePlayer, IP address:"
View Full Code Here

  }

  public void remove() {
    if (!removed && shouldRespawn && def.respawnTime() > 0) {
      Instance.getDelayedEventHandler().add(
          new DelayedEvent(null, def.respawnTime() * 1000) {

            public void run() {
              world.registerNpc(new Npc(loc));
              matchRunning = false;
            }
View Full Code Here

      this.chasing = null;
      goingToAttack = false;
      return;
    }

    chaseTimeout = new DelayedEvent(null, 15000) {

      public void run() {

        goingToAttack = false;
        setChasing(null);
View Full Code Here

            "You open and plant the seed.");
        world.registerGameObject(new GameObject(player.getLocation(),
            490, 0, 0));
        final Point location = player.getLocation();
        Instance.getDelayedEventHandler().add(
            new DelayedEvent(null, 180000) {
              GameObject object = world.getTile(location)
                  .getGameObject();

              public void run() {
                if (object != null) {
View Full Code Here

TOP

Related Classes of org.moparscape.msc.gs.event.DelayedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.