From 42a42381cbe5e6304984a9e5edae839b89d613c9 Mon Sep 17 00:00:00 2001 From: Snabeldier <79211348+Snabeldier@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:50:37 +0100 Subject: [PATCH 1/2] chore: release 1.287.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 012fc461..3084589c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ CoreAPI - 1.287.0 + 1.287.1 1.61.2 From 6da7553f457dab3589a9ee93549c0e11fdd5d0b5 Mon Sep 17 00:00:00 2001 From: Snabeldier <79211348+Snabeldier@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:48:23 +0100 Subject: [PATCH 2/2] change stuff --- src/main/java/minevalley/core/api/Core.java | 50 ++++++------------- .../java/minevalley/core/api/CoreServer.java | 18 ++++--- 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/main/java/minevalley/core/api/Core.java b/src/main/java/minevalley/core/api/Core.java index dad3aede..594ef85a 100644 --- a/src/main/java/minevalley/core/api/Core.java +++ b/src/main/java/minevalley/core/api/Core.java @@ -61,6 +61,7 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.metadata.Metadatable; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; import org.bukkit.util.Vector; import javax.annotation.Nonnull; @@ -72,7 +73,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -@SuppressWarnings("unused") +@SuppressWarnings({"unused", "UnusedReturnValue"}) public final class Core { private static CoreServer server; @@ -81,56 +82,36 @@ public static JavaPlugin getInstance() { return server.getInstance(); } - public static int runSyncTaskNow(Runnable runnable) { + @Nonnull + public static BukkitTask runSyncTaskNow(@Nonnull Runnable runnable) { return server.runSyncTaskLater(0, runnable); } - public static int runAsyncTaskNow(Runnable runnable) { + @Nonnull + public static BukkitTask runAsyncTaskNow(@Nonnull Runnable runnable) { return server.runAsyncTaskLater(0, runnable); } - public static int runSyncTaskLater(long delay, Runnable runnable) { + @Nonnull + public static BukkitTask runSyncTaskLater(long delay, @Nonnull Runnable runnable) { return server.runSyncTaskLater(delay, runnable); } - public static int runAsyncTaskLater(long delay, Runnable runnable) { + @Nonnull + public static BukkitTask runAsyncTaskLater(long delay, @Nonnull Runnable runnable) { return server.runAsyncTaskLater(delay, runnable); } - public static int runSyncTaskPeriodically(long delay, long period, Runnable runnable) { + @Nonnull + public static BukkitTask runSyncTaskPeriodically(long delay, long period, @Nonnull Runnable runnable) { return server.runSyncTaskPeriodically(delay, period, runnable); } - public static int runAsyncTaskPeriodically(long delay, long period, Runnable runnable) { + @Nonnull + public static BukkitTask runAsyncTaskPeriodically(long delay, long period, @Nonnull Runnable runnable) { return server.runAsyncTaskPeriodically(delay, period, runnable); } - /** - * Check if the task currently running. - *

- * A repeating task might not be running currently, but will be running in - * the future. A task that has finished, and does not repeat, will not be - * running ever again. - *

- * Explicitly, a task is running if there exists a thread for it, and that - * thread is alive. - * - * @param taskId The task to check. - * @return If the task is currently running. - */ - public static boolean isCurrentlyRunning(int taskId) { - return server.isCurrentlyRunning(taskId); - } - - /** - * Removes task from scheduler. - * - * @param taskId Id number of task to be removed - */ - public static void cancelTask(int taskId) { - server.cancelTask(taskId); - } - public static void registerListener(Class cls, EventListener listener) { server.registerListener(cls, listener); } @@ -198,11 +179,12 @@ public static String getName(@Nonnull UUID uniqueId) { *
* Note: If no player is found, this method returns null. *

- * Runtime Optimization + * Runtime Optimization *