更换至 Gradle

This commit is contained in:
IzzelAliz
2019-03-02 15:48:21 +08:00
parent b3233e4049
commit 57ac4e072c
311 changed files with 332 additions and 930 deletions

View File

@@ -0,0 +1,22 @@
package com.ilummc.tlibscala
import org.bukkit.scheduler.BukkitRunnable
private[tlibscala] class ScalaTaskExecutor(task: => Any) extends BukkitRunnable {
override def run(): Unit = {
try task catch {
case _: CancelException => cancel()
case e: Throwable => throw e
}
}
}
object ScalaTaskExecutor {
def apply(task: => Any): ScalaTaskExecutor = new ScalaTaskExecutor(task)
}
class CancelException extends RuntimeException {
override def getMessage: String = "Uncaught cancel task signal! Any Task.cancel() should only be used in a Task."
}