mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-4500: callSyncMethod broken
By: md_5 <git@md-5.net>
This commit is contained in:
parent
9e6d9e593e
commit
1114d726cd
2 changed files with 2 additions and 2 deletions
|
@ -437,7 +437,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
private static void validate(final Plugin plugin, final Object task) {
|
private static void validate(final Plugin plugin, final Object task) {
|
||||||
Validate.notNull(plugin, "Plugin cannot be null");
|
Validate.notNull(plugin, "Plugin cannot be null");
|
||||||
Validate.notNull(task, "Task 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()) {
|
if (!plugin.isEnabled()) {
|
||||||
throw new IllegalPluginAccessException("Plugin attempted to register task while disabled");
|
throw new IllegalPluginAccessException("Plugin attempted to register task while disabled");
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class CraftTask implements BukkitTask, Runnable {
|
||||||
this.cTask = (Consumer<BukkitTask>) task;
|
this.cTask = (Consumer<BukkitTask>) task;
|
||||||
this.rTask = null;
|
this.rTask = null;
|
||||||
} else if (task == null) {
|
} else if (task == null) {
|
||||||
// Head task
|
// Head or Future task
|
||||||
this.rTask = null;
|
this.rTask = null;
|
||||||
this.cTask = null;
|
this.cTask = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue