From 0254fa922cd97f3937d260e500298445aa497604 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Fri, 30 Oct 2020 21:49:11 +0100 Subject: [PATCH] Update ItemStackUtils.kt --- src/main/kotlin/net/axay/kspigot/items/ItemStackUtils.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/axay/kspigot/items/ItemStackUtils.kt b/src/main/kotlin/net/axay/kspigot/items/ItemStackUtils.kt index 139529de..96afc90b 100644 --- a/src/main/kotlin/net/axay/kspigot/items/ItemStackUtils.kt +++ b/src/main/kotlin/net/axay/kspigot/items/ItemStackUtils.kt @@ -3,11 +3,17 @@ package net.axay.kspigot.items import net.axay.kspigot.chat.KColors import net.md_5.bungee.api.ChatColor +@Suppress("RemoveRedundantSpreadOperator") +fun String.toLoreList(lineLength: Int = 40, lineColor: ChatColor = KColors.RESET) + = toLoreList(lineLength, *arrayOf(lineColor)) + /** * Converts this string into a list of strings, which * can be used for minecraft lorelists. */ -fun String.toLoreList(lineLength: Int = 40, lineColor: ChatColor = KColors.RESET): List { +fun String.toLoreList(lineLength: Int = 40, vararg lineColors: ChatColor = arrayOf(KColors.RESET)): List { + + val lineColor = lineColors.joinToString() val loreList = ArrayList()