Package ch.njol.skript.util

Examples of ch.njol.skript.util.Timespan


      @Override
      public void run() {
        if (!SkriptConfig.checkForNewVersion.value())
          return;
        check(Bukkit.getConsoleSender(), SkriptConfig.automaticallyDownloadNewVersion.value(), true);
        final Timespan t = SkriptConfig.updateCheckInterval.value();
        if (t.getTicks() != 0)
          setNextExecution(t.getTicks());
      }
    };
  }
View Full Code Here


      case REMOVE:
        mod = -1;
        //$FALL-THROUGH$
      case ADD:
        assert delta != null;
        final Timespan ts = (Timespan) delta[0];
        for (final World w : worlds) {
          w.setTime(w.getTime() + mod * ts.getTicks());
        }
        break;
      case DELETE:
      case REMOVE_ALL:
      case RESET:
View Full Code Here

        return;
      a = amp.intValue() - 1;
    }
    int d = DEFAULT_DURATION;
    if (duration != null) {
      final Timespan dur = duration.getSingle(e);
      if (dur == null)
        return;
      d = dur.getTicks();
    }
    for (final LivingEntity en : entities.getArray(e)) {
      for (final PotionEffectType t : ts) {
        int duration = d;
        if (en.hasPotionEffect(t)) {
View Full Code Here

    debug(e, true);
    final long start = Skript.debug() ? System.nanoTime() : 0;
    final TriggerItem next = getNext();
    if (next != null) {
      delayed.add(e);
      final Timespan d = duration.getSingle(e);
      if (d == null)
        return null;
      Bukkit.getScheduler().scheduleSyncDelayedTask(Skript.getInstance(), new Runnable() {
        @Override
        public void run() {
          if (Skript.debug())
            Skript.info(getIndentation() + "... continuing after " + (System.nanoTime() - start) / 1000000000. + "s");
          TriggerItem.walk(next, e);
        }
      }, d.getTicks());
    }
    return null;
  }
View Full Code Here

//        }
        return false;
      }
     
      if (!"0".equals(getValue(n, "backup interval"))) {
        final Timespan backupInterval = getValue(n, "backup interval", Timespan.class);
        if (backupInterval != null)
          startBackupTask(backupInterval);
      }
    }
   
View Full Code Here

        (byte) 127, (short) 2000, -1600000, 1L << 40, -1.5f, 13.37,
        "String",
       
        // Skript
        Color.BLACK, StructureType.RED_MUSHROOM, WeatherType.THUNDER,
        new Date(System.currentTimeMillis()), new Timespan(1337), new Time(12000), new Timeperiod(1000, 23000),
        new Experience(15), new Direction(0, Math.PI, 10), new Direction(new double[] {0, 1, 0}),
        new EntityType(new SimpleEntityData(HumanEntity.class), 300), new CreeperData(), new SimpleEntityData(Snowball.class), new HorseData(Variant.SKELETON_HORSE), new WolfData(), new XpOrbData(50),
       
        // Bukkit - simple classes only
        GameMode.ADVENTURE, Biome.EXTREME_HILLS, DamageCause.FALL,
View Full Code Here

 
  @Override
  protected void execute(final Event e) {
    final int d;
    if (duration != null) {
      final Timespan t = duration.getSingle(e);
      if (t == null)
        return;
      d = t.getTicks();
    } else {
      d = ignite ? DEFAULT_DURATION : 0;
    }
    for (final Entity en : entities.getArray(e)) {
      if (e instanceof EntityDamageEvent && ((EntityDamageEvent) e).getEntity() == en && !Delay.isDelayed(e)) {
View Full Code Here

 
  @Override
  protected void execute(final Event e) {
    for (final LivingEntity le : entites.getArray(e)) {
      if (!cure) {
        Timespan dur;
        int d = duration != null && (dur = duration.getSingle(e)) != null ? dur.getTicks() : DEFAULT_DURATION;
        if (le.hasPotionEffect(PotionEffectType.POISON)) {
          for (final PotionEffect pe : le.getActivePotionEffects()) {
            if (pe.getType() != PotionEffectType.POISON)
              continue;
            d += pe.getDuration();
View Full Code Here

      Skript.error("You need the plugin SQLibrary in order to use a database with Skript. You can download the latest version from http://dev.bukkit.org/server-mods/sqlibrary/files/");
      return false;
    }
   
    final Boolean monitor_changes = getValue(n, "monitor changes", Boolean.class);
    final Timespan monitor_interval = getValue(n, "monitor interval", Timespan.class);
    if (monitor_changes == null || monitor_interval == null)
      return false;
    monitor = monitor_changes;
    this.monitor_interval = monitor_interval.getMilliSeconds();
   
    final Database db;
    try {
      final Object o = type.initialise(this, n);
      if (o == null)
View Full Code Here

TOP

Related Classes of ch.njol.skript.util.Timespan

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.