From 1c92414cad7e2b4b9cecffc1b9930483379470f4 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 15 Aug 2021 13:14:38 +0200 Subject: [PATCH] Add `TaskBuilder#build` --- .../minestom/server/timer/TaskBuilder.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/timer/TaskBuilder.java b/src/main/java/net/minestom/server/timer/TaskBuilder.java index cf527bf1e..178d70549 100644 --- a/src/main/java/net/minestom/server/timer/TaskBuilder.java +++ b/src/main/java/net/minestom/server/timer/TaskBuilder.java @@ -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) {