mirror of
https://github.com/5vl/ItemAdder.git
synced 2025-05-24 10:46:57 +00:00
smh changed ig
This commit is contained in:
parent
8102be41df
commit
527f88befd
@ -7,6 +7,8 @@ import net.kyori.adventure.text.Component
|
|||||||
import org.bukkit.Material
|
import org.bukkit.Material
|
||||||
import org.bukkit.event.player.PlayerInteractEvent
|
import org.bukkit.event.player.PlayerInteractEvent
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.collections.HashMap
|
||||||
|
|
||||||
class Item(uniqueName: String, name: String, private val rarity: Rarity, material: Material, private val type: ItemType, private val lore: String) {
|
class Item(uniqueName: String, name: String, private val rarity: Rarity, material: Material, private val type: ItemType, private val lore: String) {
|
||||||
val finalItem: ItemStack
|
val finalItem: ItemStack
|
||||||
@ -26,7 +28,14 @@ class Item(uniqueName: String, name: String, private val rarity: Rarity, materia
|
|||||||
abilities[runnable] = abilityType
|
abilities[runnable] = abilityType
|
||||||
val clickType = if (abilityType == AbilityType.LEFT_CLICK) "Left click" else if (abilityType == AbilityType.RIGHT_CLICK) "Right click" else "Other type"
|
val clickType = if (abilityType == AbilityType.LEFT_CLICK) "Left click" else if (abilityType == AbilityType.RIGHT_CLICK) "Right click" else "Other type"
|
||||||
val meta = finalItem.itemMeta
|
val meta = finalItem.itemMeta
|
||||||
meta.lore(Utils.loreBuilder(lore, "", "<yellow><bold>$clickType: <gold>$name", addLore, rarity.formatted + " " + type.type))
|
val newLore = meta.lore()!!
|
||||||
|
val lastLine = newLore.last()!!
|
||||||
|
newLore.remove(lastLine)
|
||||||
|
val sj = StringJoiner("\n")
|
||||||
|
for (line in newLore) {
|
||||||
|
sj.add(line.toString())
|
||||||
|
}
|
||||||
|
meta.lore(Utils.loreBuilder(sj.toString(), "<yellow><bold>$clickType: <gold>$name", addLore, " ", rarity.formatted + " " + type.type))
|
||||||
finalItem.itemMeta = meta
|
finalItem.itemMeta = meta
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user