Skip to content

Commit c3f3fd8

Browse files
committed
* New Schedule BukkitRunnable task handling.
1 parent 29bb8c8 commit c3f3fd8

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/main/java/com/github/sanctum/labyrinth/Labyrinth.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.github.sanctum.labyrinth.gui.Menu;
1111
import com.github.sanctum.labyrinth.library.Item;
1212
import com.github.sanctum.labyrinth.library.SkullItem;
13+
import com.github.sanctum.labyrinth.task.Schedule;
1314
import java.io.InputStream;
1415
import java.util.Arrays;
1516
import java.util.HashMap;

src/main/java/com/github/sanctum/labyrinth/task/Schedule.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,38 @@
22

33

44
import com.github.sanctum.labyrinth.library.Applicable;
5+
import org.bukkit.entity.Player;
56

67
public class Schedule {
78

9+
/**
10+
* A basic builder for a synchronous specific task you wish to complete.
11+
*
12+
* <p>Execution Results: [run, wait, repeat, repeatReal, waitReal]
13+
*
14+
* Pre-conditions: [{@link Synchronous#cancelEmpty()},
15+
* {@link Synchronous#cancelAfter(Player)},
16+
* {@link Synchronous#cancelAfter(int)}]</p>
17+
*
18+
* @param applicable The applicable data to execute within the task via void or lambda reference.
19+
* @return A synchronous task builder.
20+
*/
821
public static Synchronous sync(Applicable applicable) {
922
return new Synchronous(applicable);
1023
}
1124

25+
/**
26+
* A basic builder for an asynchronous specific task you wish to complete.
27+
*
28+
* <p>Execution Results: [run, wait, repeat]
29+
*
30+
* Pre-conditions: [{@link Asynchronous#cancelAfter(Player)},
31+
* {@link Asynchronous#cancelAfter(int)},
32+
* {@link Asynchronous#cancelEmpty()}]</p>
33+
*
34+
* @param applicable The applicable data to execute within the task via void or lambda reference.
35+
* @return A synchronous task builder.
36+
*/
1237
public static Asynchronous async(Applicable applicable) {
1338
return new Asynchronous(applicable);
1439
}

0 commit comments

Comments
 (0)