Skip to content

Commit

Permalink
* New Schedule BukkitRunnable task handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hempfest committed Feb 27, 2021
1 parent 29bb8c8 commit c3f3fd8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/github/sanctum/labyrinth/Labyrinth.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.github.sanctum.labyrinth.gui.Menu;
import com.github.sanctum.labyrinth.library.Item;
import com.github.sanctum.labyrinth.library.SkullItem;
import com.github.sanctum.labyrinth.task.Schedule;
import java.io.InputStream;
import java.util.Arrays;
import java.util.HashMap;
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/github/sanctum/labyrinth/task/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,38 @@


import com.github.sanctum.labyrinth.library.Applicable;
import org.bukkit.entity.Player;

public class Schedule {

/**
* A basic builder for a synchronous specific task you wish to complete.
*
* <p>Execution Results: [run, wait, repeat, repeatReal, waitReal]
*
* Pre-conditions: [{@link Synchronous#cancelEmpty()},
* {@link Synchronous#cancelAfter(Player)},
* {@link Synchronous#cancelAfter(int)}]</p>
*
* @param applicable The applicable data to execute within the task via void or lambda reference.
* @return A synchronous task builder.
*/
public static Synchronous sync(Applicable applicable) {
return new Synchronous(applicable);
}

/**
* A basic builder for an asynchronous specific task you wish to complete.
*
* <p>Execution Results: [run, wait, repeat]
*
* Pre-conditions: [{@link Asynchronous#cancelAfter(Player)},
* {@link Asynchronous#cancelAfter(int)},
* {@link Asynchronous#cancelEmpty()}]</p>
*
* @param applicable The applicable data to execute within the task via void or lambda reference.
* @return A synchronous task builder.
*/
public static Asynchronous async(Applicable applicable) {
return new Asynchronous(applicable);
}
Expand Down

0 comments on commit c3f3fd8

Please sign in to comment.