From 1114d726cddc73b21424951b137811b8228d3065 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 24 Nov 2018 17:52:29 +1100 Subject: [PATCH] SPIGOT-4500: callSyncMethod broken By: md_5 --- .../java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java | 2 +- .../main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index b5c22e209f..557f72d621 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -437,7 +437,7 @@ public class CraftScheduler implements BukkitScheduler { private static void validate(final Plugin plugin, final Object task) { Validate.notNull(plugin, "Plugin cannot be null"); Validate.notNull(task, "Task cannot be null"); - Validate.isTrue(task instanceof Runnable || task instanceof Consumer, "Task must be Runnable or Consumer"); + Validate.isTrue(task instanceof Runnable || task instanceof Consumer || task instanceof Callable, "Task must be Runnable, Consumer, or Callable"); if (!plugin.isEnabled()) { throw new IllegalPluginAccessException("Plugin attempted to register task while disabled"); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java index 15c62552e7..a85fbbb693 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -46,7 +46,7 @@ class CraftTask implements BukkitTask, Runnable { this.cTask = (Consumer) task; this.rTask = null; } else if (task == null) { - // Head task + // Head or Future task this.rTask = null; this.cTask = null; } else {