All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tr.com.infumia.task.BukkitInternalTask Maven / Gradle / Ivy

The newest version!
package tr.com.infumia.task;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Predicate;
import lombok.Getter;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;

@Getter
final class BukkitInternalTask extends BukkitRunnable implements InternalTask {

  @NotNull
  private final Predicate backingTask;

  @NotNull
  private final AtomicBoolean cancelled = new AtomicBoolean(false);

  @NotNull
  private final AtomicInteger counter = new AtomicInteger(0);

  BukkitInternalTask(@NotNull final Predicate backingTask) {
    this.backingTask = backingTask;
  }

  @Override
  public int id() {
    return this.getTaskId();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy