Commit Graph

12 Commits

Author SHA1 Message Date
bluefireoly
8ba0a7bd4a Changed "bukkit" in the name of runnable methods to "task" 2020-10-23 00:09:58 +02:00
bluefireoly
da848728d2 Applied kotlin style conventions 2020-10-18 18:36:49 +02:00
bluefireoly
f606fac7a4 Reformatted code and added documentation 2020-10-18 17:16:04 +02:00
bluefireoly
dcdb817a7c Changed runTask to bukkitRun
Changed the runTask method to bukkitRun and added documentation
2020-10-18 16:53:10 +02:00
F0Xde
c872a94fb2 Make exception handler last argument 2020-10-18 11:30:13 +02:00
F0Xde
95a6eef6df Use reified type parameter for executeCatching; sync / async handlers
The unsafe cast before would throw an exception if any other generic
parameter than `Exception` was used without passing the class reference
explicitly.

It can now also be specified whether the exception handler is to be
executed sync or async, defaulting to sync.
2020-10-18 11:16:03 +02:00
bluefireoly
c3f070c750 Update ChainableRunnables.kt 2020-10-17 14:59:25 +02:00
bluefireoly
0daae1d064 Update ChainableRunnables.kt 2020-10-17 14:45:55 +02:00
F0Xde
0657c91f0f Allow catching of exceptions in chained runnables
The user can handle exceptions of a specified type occurring in a chained
runnable by calling `executeCatching` and optionally passing a handler
function.

This is needed needed in order to gracefully stop the execution of a
runnable chain without the exception being caught by Bukkit and
resulting in it being logged as uncaught, while also allowing further
handling of the exception.
2020-10-17 14:02:13 +02:00
bluefireoly
413c587e29 Improved ChainableRunnables 2020-10-12 18:12:05 +02:00
bluefireoly
29bd82803d Eliminated plugin and kSpigot parameters 2020-10-12 17:01:01 +02:00
bluefireoly
9846e8098c Create ChainableRunnables.kt 2020-09-15 17:06:37 +02:00