Added await function for paged book input

This commit is contained in:
bluefireoly
2020-10-27 13:33:09 +01:00
parent 8523ae75dc
commit aa4cf81fcf

View File

@@ -42,13 +42,20 @@ fun Player.awaitAnvilInput(
PlayerInputAnvilInv(this, callback, timeoutSeconds, invTitle, startText, renameItemDescription)
}
fun Player.awaitBookInput(
fun Player.awaitBookInputAsString(
timeoutSeconds: Int = 1 * 60,
callback: (PlayerInputResult<String>) -> Unit
) {
PlayerInputBookComprehensive(this, callback, timeoutSeconds)
}
fun Player.awaitBookInputAsList(
timeoutSeconds: Int = 1 * 60,
callback: (PlayerInputResult<List<String>>) -> Unit
) {
PlayerInputBookPaged(this, callback, timeoutSeconds)
}
class PlayerInputResult<T> internal constructor(val input: T?)
internal abstract class PlayerInput<T>(