mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Add TaskBuilder#build
This commit is contained in:
parent
2674ca933e
commit
1c92414cad
@ -138,11 +138,28 @@ public class TaskBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedules this {@link Task} for execution.
|
* Builds a {@link Task}.
|
||||||
*
|
*
|
||||||
* @return the built {@link Task}
|
* @return the built {@link Task}
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
|
public Task build() {
|
||||||
|
return new Task(
|
||||||
|
this.schedulerManager,
|
||||||
|
this.runnable,
|
||||||
|
this.shutdown,
|
||||||
|
this.delay,
|
||||||
|
this.repeat,
|
||||||
|
this.isTransient,
|
||||||
|
this.owningExtension);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schedules this {@link Task} for execution.
|
||||||
|
*
|
||||||
|
* @return the scheduled {@link Task}
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
public Task schedule() {
|
public Task schedule() {
|
||||||
Task task = build();
|
Task task = build();
|
||||||
if (this.shutdown) {
|
if (this.shutdown) {
|
||||||
|
Loading…
Reference in New Issue
Block a user