SPIGOT-4500: callSyncMethod broken

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2018-11-24 17:52:29 +11:00
parent 9e6d9e593e
commit 1114d726cd
2 changed files with 2 additions and 2 deletions

View file

@ -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");
}

View file

@ -46,7 +46,7 @@ class CraftTask implements BukkitTask, Runnable {
this.cTask = (Consumer<BukkitTask>) task;
this.rTask = null;
} else if (task == null) {
// Head task
// Head or Future task
this.rTask = null;
this.cTask = null;
} else {