From 9984787202b73c2f21b034d84b0511e5b269dd03 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Fri, 17 Jan 2020 17:45:39 +0800 Subject: [PATCH] fix: sponge task callSyncMethod Signed-off-by: MiaoWoo --- packages/sponge/src/task.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sponge/src/task.ts b/packages/sponge/src/task.ts index 85772031..ae3a7adc 100644 --- a/packages/sponge/src/task.ts +++ b/packages/sponge/src/task.ts @@ -17,7 +17,10 @@ export class SpongeTaskManager implements task.TaskManager { return new SpongeTask(this.pluginInstance, func); } callSyncMethod(func: Function): any { - return Sponge.getScheduler().createSyncExecutor(this.pluginInstance).schedule(new Callable({ call: () => func() }), 0, TimeUnit.NANOSECONDS).get() + return Sponge.getScheduler() + .createSyncExecutor(this.pluginInstance) + // @ts-ignore + .schedule(new Callable({ call: () => func() }), java.lang.Long.valueOf(0), TimeUnit.NANOSECONDS).get() } }