diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/ClientItemGroup.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/ClientItemGroup.kt index 82d0aa79fac..4f257773f80 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/ClientItemGroup.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/ClientItemGroup.kt @@ -26,13 +26,14 @@ import net.minecraft.item.ItemStack import net.minecraft.registry.Registries import net.minecraft.registry.Registry import net.minecraft.util.Identifier +import java.util.function.Supplier /** * An item group from the client */ open class ClientItemGroup( val plainName: String, - val icon: () -> ItemStack, + val icon: Supplier, val items: (items: ItemGroup.Entries) -> Unit ) { diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/groups/ExploitsItemGroup.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/groups/ExploitsItemGroup.kt index 8055f8e3366..2ce1ed6793a 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/groups/ExploitsItemGroup.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/itemgroup/groups/ExploitsItemGroup.kt @@ -46,10 +46,10 @@ class ExploitsItemGroup : ClientItemGroup( it.add(ItemStack(Items.DEBUG_STICK)) // Add unobtainable potions - @Suppress("SpreadOperator") - it.add(createSplashPotion("Troll Potion", *Registries.STATUS_EFFECT.streamEntries().map { statusEffect -> - StatusEffectInstance(statusEffect, Int.MAX_VALUE, 127) - }.toArray { len -> arrayOfNulls(len) })) + it.add(createSplashPotion("Troll Potion", + effects = Registries.STATUS_EFFECT.streamEntries().map { statusEffect -> + StatusEffectInstance(statusEffect, Int.MAX_VALUE, 127) + }.toArray(::arrayOfNulls))) it.add(createSplashPotion("Kill Potion", StatusEffectInstance(StatusEffects.INSTANT_HEALTH, 0, 125), diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/features/ScriptCommandBuilder.kt b/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/features/ScriptCommandBuilder.kt index 692fc8d549f..f77d2582d8b 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/features/ScriptCommandBuilder.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/features/ScriptCommandBuilder.kt @@ -38,10 +38,9 @@ class ScriptCommandBuilder(private val commandObject: Value) { emptyArray() } - @Suppress("SpreadOperator") val commandBuilder = CommandBuilder .begin(commandObject.getMember("name").asString()) - .alias(*aliases) + .alias(aliases = aliases) if (commandObject.hasMember("subcommands")) { val subcommands = commandObject.getMember("subcommands").`as`(Array::class.java)