Package ch.njol.skript.lang

Examples of ch.njol.skript.lang.Trigger


      }
    }, 0, CHECKPERIOD);
  }
 
  void execute(final World w) {
    final Trigger t = this.t;
    if (t == null) {
      assert false;
      return;
    }
    final ScheduledEvent e = new ScheduledEvent(w);
    SkriptEventHandler.logEventStart(e);
    SkriptEventHandler.logTriggerEnd(t);
    t.execute(e);
    SkriptEventHandler.logTriggerEnd(t);
    SkriptEventHandler.logEventEnd();
  }
View Full Code Here


    }
    return true;
  }
 
  void execute(final @Nullable World w) {
    final Trigger t = this.t;
    if (t == null) {
      assert false;
      return;
    }
    final ScheduledEvent e = w == null ? new ScheduledNoWorldEvent() : new ScheduledEvent(w);
    SkriptEventHandler.logEventStart(e);
    SkriptEventHandler.logTriggerStart(t);
    t.execute(e);
    SkriptEventHandler.logTriggerEnd(t);
    SkriptEventHandler.logEventEnd();
  }
View Full Code Here

         
          if (Skript.debug() || node.debug())
            Skript.debug(event + " (" + parsedEvent.getSecond().toString(null, true) + "):");
         
          setCurrentEvent("" + parsedEvent.getFirst().getName().toLowerCase(Locale.ENGLISH), parsedEvent.getFirst().events);
          final Trigger trigger;
          try {
            trigger = new Trigger(config.getFile(), event, parsedEvent.getSecond(), loadItems(node));
          } finally {
            deleteCurrentEvent();
          }
         
          if (parsedEvent.getSecond() instanceof SelfRegisteringSkriptEvent) {
View Full Code Here

      return null;
    }
   
    setCurrentEvent("unit test", parsedEvent.getFirst().events);
    try {
      return new Trigger(null, event, parsedEvent.getSecond(), loadItems(node));
    } finally {
      deleteCurrentEvent();
    }
  }
View Full Code Here

      @Override
      public Trigger next() {
        final Iterator<Trigger> current = this.current;
        if (current == null || !hasNext())
          throw new NoSuchElementException();
        final Trigger next = current.next();
        assert next != null;
        return next;
      }
     
      @Override
View Full Code Here

        Skript.info(" -x- was cancelled");
      return;
    }
   
    while (ts.hasNext()) {
      final Trigger t = ts.next();
      if (!t.getEvent().check(e))
        continue;
      logTriggerStart(t);
      t.execute(e);
      logTriggerEnd(t);
    }
   
    logEventEnd();
  }
View Full Code Here

        }
      }
    }
   
    for (int i = 0; i < selfRegisteredTriggers.size(); i++) {
      final Trigger t = selfRegisteredTriggers.get(i);
      if (script.equals(t.getScript())) {
        info.triggers++;
        ((SelfRegisteringSkriptEvent) t.getEvent()).unregister(t);
        selfRegisteredTriggers.remove(i);
        i--;
      }
    }
   
View Full Code Here

    this.executableBy = executableBy;
   
    this.pattern = pattern;
    this.arguments = arguments;
   
    trigger = new Trigger(script, "command /" + name, new SimpleEvent(), items);
   
    bukkitCommand = setupBukkitCommand();
  }
View Full Code Here

    // here to allow recursion
    Functions.functions.put(name, new FunctionData(this));
   
    Functions.currentFunction = this;
    try {
      trigger = new Trigger(node.getConfig().getFile(), "function " + name, new SimpleEvent(), ScriptLoader.loadItems(node));
    } finally {
      Functions.currentFunction = null;
    }
  }
View Full Code Here

          }
          w.println("[" + SkriptConfig.formatDate(System.currentTimeMillis()) + "] " + message);
          w.flush();
        }
      } else {
        final Trigger t = getTrigger();
        final File script = t == null ? null : t.getScript();
        Skript.info("[" + (script != null ? script.getName() : "---") + "] " + message);
      }
    }
  }
View Full Code Here

TOP

Related Classes of ch.njol.skript.lang.Trigger

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.