mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-06-11 06:59:28 +02:00
LordMZTE
a5d5562d93
remove mergeTo function due to stdlib containing alternative getModMetas now takes predicate
27 lines
805 B
Kotlin
27 lines
805 B
Kotlin
package ley.anvil.modpacktools.command
|
|
|
|
data class CommandReturn constructor(val ret: String?, val success: Boolean) {
|
|
companion object {
|
|
/**
|
|
* Get a failed [CommandReturn]. This should be used if something went wrong
|
|
*
|
|
* @param ret the error message
|
|
* @return the [CommandReturn]
|
|
*/
|
|
@JvmStatic
|
|
@JvmOverloads
|
|
fun fail(ret: String? = null) = CommandReturn(ret, false)
|
|
|
|
/**
|
|
* Get a successful [CommandReturn]. Use this if the command was executed successfully
|
|
*
|
|
* @param ret a return message
|
|
* @return the [CommandReturn]
|
|
*/
|
|
@JvmStatic
|
|
@JvmOverloads
|
|
fun success(ret: String? = null) = CommandReturn(ret, true)
|
|
}
|
|
fun hasRet() = ret != null
|
|
}
|