mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 18:32:28 +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}
|
||||
*/
|
||||
@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() {
|
||||
Task task = build();
|
||||
if (this.shutdown) {
|
||||
|
Loading…
Reference in New Issue
Block a user