feat: compatible brower behavior

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-05-30 10:43:33 +08:00
parent c9ca4ffd39
commit c45bbb9821
10 changed files with 94 additions and 96 deletions

View File

@ -23,10 +23,8 @@ export class BukkitTaskManager implements task.TaskManager {
}
export class BukkitTask extends task.Task {
submit(): task.Cancelable {
let run = new BukkitRunnable({
run: () => this.run()
})
submit(...args: any[]): task.Cancelable {
let run = new BukkitRunnable({ run: () => this.run(...args) })
let funcName = `runTask${this.interval ? 'Timer' : 'Later'}${this.isAsync ? 'Asynchronously' : ''}`
if (this.interval) {
return run[funcName](this.plugin, this.laterTime, this.interval)