Update formatting
This commit is contained in:
@@ -8,6 +8,7 @@ abstract class ChainedRunnablePart<T, R>(
|
||||
val sync: Boolean,
|
||||
) {
|
||||
var next: ChainedRunnablePart<R, *>? = null
|
||||
|
||||
protected abstract fun invoke(data: T): R
|
||||
|
||||
/**
|
||||
@@ -79,6 +80,7 @@ class ChainedRunnablePartFirst<R>(
|
||||
sync: Boolean,
|
||||
) : ChainedRunnablePart<Unit, R>(sync) {
|
||||
override fun execute() = start(Unit)
|
||||
|
||||
override fun <E : Exception> executeCatchingImpl(
|
||||
exceptionClass: KClass<E>,
|
||||
exceptionSync: Boolean,
|
||||
@@ -94,6 +96,7 @@ class ChainedRunnablePartThen<T, R>(
|
||||
val previous: ChainedRunnablePart<*, T>,
|
||||
) : ChainedRunnablePart<T, R>(sync) {
|
||||
override fun execute() = previous.execute()
|
||||
|
||||
override fun <E : Exception> executeCatchingImpl(
|
||||
exceptionClass: KClass<E>,
|
||||
exceptionSync: Boolean,
|
||||
@@ -113,4 +116,4 @@ fun <T, R, U> ChainedRunnablePart<T, R>.thenDo(sync: Boolean, runnable: (R) -> U
|
||||
ChainedRunnablePartThen(runnable, sync, this).apply { previous.next = this }
|
||||
|
||||
fun <T, R, U> ChainedRunnablePart<T, R>.thenSync(runnable: (R) -> U) = thenDo(true, runnable)
|
||||
fun <T, R, U> ChainedRunnablePart<T, R>.thenAsync(runnable: (R) -> U) = thenDo(false, runnable)
|
||||
fun <T, R, U> ChainedRunnablePart<T, R>.thenAsync(runnable: (R) -> U) = thenDo(false, runnable)
|
||||
|
@@ -127,4 +127,4 @@ fun sync(runnable: () -> Unit) = Bukkit.getScheduler().runTask(KSpigotMainInstan
|
||||
/**
|
||||
* Starts an asynchronous task.
|
||||
*/
|
||||
fun async(runnable: () -> Unit) = Bukkit.getScheduler().runTaskAsynchronously(KSpigotMainInstance, runnable)
|
||||
fun async(runnable: () -> Unit) = Bukkit.getScheduler().runTaskAsynchronously(KSpigotMainInstance, runnable)
|
||||
|
Reference in New Issue
Block a user