Package dev.kotx.flylib.util

Types

ComponentBuilder
Link copied to clipboard
class ComponentBuilder

A builder that makes components easy to use from Kotlin.

ComponentBuilderAction
Link copied to clipboard
fun interface ComponentBuilderAction

ComponentBuilder's builder lambda function.

ItemBuilder
Link copied to clipboard
class ItemBuilder(material: Material)

Item builder to create custom itemStack

ItemBuilderAction
Link copied to clipboard
fun interface ItemBuilderAction

Item builder actions for Java

JsonArrayBuilder
Link copied to clipboard
class JsonArrayBuilder
JsonBuilder
Link copied to clipboard
class JsonBuilder
MetaBuilder
Link copied to clipboard
fun interface MetaBuilder

Item Meta builder actions for java

Functions

asJsonArray
Link copied to clipboard
fun String.asJsonArray(): JsonArray
asJsonElement
Link copied to clipboard
fun String.asJsonElement(): JsonElement
asJsonObject
Link copied to clipboard
fun String.asJsonObject(): JsonObject
clear
Link copied to clipboard
fun BookMeta.clear(): BookMeta

Clear all pages.

component
Link copied to clipboard
fun component(builder: ComponentBuilderAction): @NonNull TextComponent

Create a TextComponent using ComponentBuilder.

fun String.component(color: Color): @NonNull TextComponent

Converts a String to a Text Component. You can also specify the Color.

fun String.component(style: Style = Style.empty()): @NonNull TextComponent

Converts a String to a Text Component. You can also specify the Style.

fail
Link copied to clipboard
fun CommandSender.fail(text: String)

send red string

getArray
Link copied to clipboard
fun JsonElement.getArray(key: String): JsonArray
fun JsonObject.getArray(key: String): JsonArray
getArrayArray
Link copied to clipboard
fun JsonElement.getArrayArray(key: String): List<JsonArray>
fun JsonObject.getArrayArray(key: String): List<JsonArray>
getArrayArrayOrNull
Link copied to clipboard
fun JsonElement.getArrayArrayOrNull(key: String): List<JsonArray>?
fun JsonObject.getArrayArrayOrNull(key: String): List<JsonArray>?
getArrayOrNull
Link copied to clipboard
fun JsonElement.getArrayOrNull(key: String): JsonArray?
fun JsonObject.getArrayOrNull(key: String): JsonArray?
getBoolean
Link copied to clipboard
fun JsonElement.getBoolean(key: String): Boolean
fun JsonObject.getBoolean(key: String): Boolean
getBooleanArray
Link copied to clipboard
fun JsonObject.getBooleanArray(key: String): List<Boolean>
getBooleanArrayOrNull
Link copied to clipboard
fun JsonObject.getBooleanArrayOrNull(key: String): List<Boolean?>?
getBooleanOrNull
Link copied to clipboard
fun JsonElement.getBooleanOrNull(key: String): Boolean?
fun JsonObject.getBooleanOrNull(key: String): Boolean?
getDouble
Link copied to clipboard
fun JsonElement.getDouble(key: String): Double
fun JsonObject.getDouble(key: String): Double
getDoubleArray
Link copied to clipboard
fun JsonObject.getDoubleArray(key: String): List<Double>
getDoubleArrayOrNull
Link copied to clipboard
fun JsonObject.getDoubleArrayOrNull(key: String): List<Double?>?
getDoubleOrNull
Link copied to clipboard
fun JsonElement.getDoubleOrNull(key: String): Double?
fun JsonObject.getDoubleOrNull(key: String): Double?
getFloat
Link copied to clipboard
fun JsonElement.getFloat(key: String): Float
fun JsonObject.getFloat(key: String): Float
getFloatArray
Link copied to clipboard
fun JsonObject.getFloatArray(key: String): List<Float>
getFloatArrayOrNull
Link copied to clipboard
fun JsonObject.getFloatArrayOrNull(key: String): List<Float?>?
getFloatOrNull
Link copied to clipboard
fun JsonElement.getFloatOrNull(key: String): Float?
fun JsonObject.getFloatOrNull(key: String): Float?
getInstant
Link copied to clipboard
fun JsonObject.getInstant(key: String): Instant
getInstantOrNull
Link copied to clipboard
fun JsonObject.getInstantOrNull(key: String): Instant?
getInt
Link copied to clipboard
fun JsonElement.getInt(key: String): Int
fun JsonObject.getInt(key: String): Int
getIntArray
Link copied to clipboard
fun JsonObject.getIntArray(key: String): List<Int>
getIntArrayOrNull
Link copied to clipboard
fun JsonObject.getIntArrayOrNull(key: String): List<Int?>?
getIntOrNull
Link copied to clipboard
fun JsonElement.getIntOrNull(key: String): Int?
fun JsonObject.getIntOrNull(key: String): Int?
getLong
Link copied to clipboard
fun JsonElement.getLong(key: String): Long
fun JsonObject.getLong(key: String): Long
getLongArray
Link copied to clipboard
fun JsonObject.getLongArray(key: String): List<Long>
getLongArrayOrNull
Link copied to clipboard
fun JsonObject.getLongArrayOrNull(key: String): List<Long?>?
getLongOrNull
Link copied to clipboard
fun JsonElement.getLongOrNull(key: String): Long?
fun JsonObject.getLongOrNull(key: String): Long?
getObject
Link copied to clipboard
fun JsonElement.getObject(key: String): JsonObject
fun JsonObject.getObject(key: String): JsonObject
getObjectArray
Link copied to clipboard
fun JsonElement.getObjectArray(key: String): List<JsonObject>
fun JsonObject.getObjectArray(key: String): List<JsonObject>
getObjectArrayOrNull
Link copied to clipboard
fun JsonElement.getObjectArrayOrNull(key: String): List<JsonObject>?
fun JsonObject.getObjectArrayOrNull(key: String): List<JsonObject>?
getObjectOrNull
Link copied to clipboard
fun JsonElement.getObjectOrNull(key: String): JsonObject?
fun JsonObject.getObjectOrNull(key: String): JsonObject?
getPrimitive
Link copied to clipboard
fun JsonElement.getPrimitive(key: String): JsonPrimitive
fun JsonObject.getPrimitive(key: String): JsonPrimitive
getPrimitiveArray
Link copied to clipboard
fun JsonElement.getPrimitiveArray(key: String): List<JsonPrimitive>
fun JsonObject.getPrimitiveArray(key: String): List<JsonPrimitive>
getPrimitiveArrayOrNull
Link copied to clipboard
fun JsonElement.getPrimitiveArrayOrNull(key: String): List<JsonPrimitive>?
fun JsonObject.getPrimitiveArrayOrNull(key: String): List<JsonPrimitive>?
getPrimitiveOrNull
Link copied to clipboard
fun JsonElement.getPrimitiveOrNull(key: String): JsonPrimitive?
fun JsonObject.getPrimitiveOrNull(key: String): JsonPrimitive?
getString
Link copied to clipboard
fun JsonElement.getString(key: String): String
fun JsonObject.getString(key: String): String
getStringArray
Link copied to clipboard
fun JsonObject.getStringArray(key: String): List<String>
getStringArrayOrNull
Link copied to clipboard
fun JsonObject.getStringArrayOrNull(key: String): List<String?>?
getStringOrNull
Link copied to clipboard
fun JsonElement.getStringOrNull(key: String): String?
fun JsonObject.getStringOrNull(key: String): String?
json
Link copied to clipboard
fun json(block: JsonBuilder.() -> Unit): JsonObject
jsonArray
Link copied to clipboard
fun jsonArray(block: JsonArrayBuilder.() -> Unit): JsonArray
message
Link copied to clipboard
fun CommandSender.message(builder: ComponentBuilderAction)

send component via builder

fun CommandSender.message(text: String)

send string message

fun CommandSender.message(component: Component)

send component

fun CommandSender.message(text: String, color: Color)

send string colored message

page
Link copied to clipboard
fun BookMeta.page(block: ComponentBuilderAction): BookMeta

Adds page using component builder

fun BookMeta.page(text: String): BookMeta

Adds page with text

parseToObject
Link copied to clipboard
inline fun <T> String.parseToObject(): T
pluginMessage
Link copied to clipboard
fun CommandSender.pluginMessage(plugin: JavaPlugin, builder: ComponentBuilderAction)

send component via builder with plugin name

fun CommandSender.pluginMessage(plugin: JavaPlugin, text: String)

send string with plugin name

fun CommandSender.pluginMessage(plugin: JavaPlugin, component: Component)

send component with plugin name

fun CommandSender.pluginMessage(plugin: JavaPlugin, text: String, color: Color)

send colored string with plugin name

pluginMessageFail
Link copied to clipboard
fun CommandSender.pluginMessageFail(plugin: JavaPlugin, text: String)

send red string with plugin name

pluginMessageSuccess
Link copied to clipboard
fun CommandSender.pluginMessageSuccess(plugin: JavaPlugin, text: String)

send green string with plugin name

pluginMessageWarn
Link copied to clipboard
fun CommandSender.pluginMessageWarn(plugin: JavaPlugin, text: String)

send yellow string with plugin name

success
Link copied to clipboard
fun CommandSender.success(text: String)

send green string

warn
Link copied to clipboard
fun CommandSender.warn(text: String)

send yellow string