Fixed talismans give bug

This commit is contained in:
Auxilor
2022-09-02 10:48:40 +01:00
parent 9fd65634e5
commit 21b2255e43

View File

@@ -31,7 +31,7 @@ class Talisman(
val description = config.getFormattedStrings("description").map { Display.PREFIX + it } val description = config.getFormattedStrings("description").map { Display.PREFIX + it }
val itemStack: ItemStack = run { private val _itemStack: ItemStack = run {
val item = Items.lookup(config.getString("item")) val item = Items.lookup(config.getString("item"))
Validate.isTrue(item !is EmptyTestableItem, "Item specified in " + key.key + " is invalid!") Validate.isTrue(item !is EmptyTestableItem, "Item specified in " + key.key + " is invalid!")
TalismanUtils.registerTalismanMaterial(item.item.type) TalismanUtils.registerTalismanMaterial(item.item.type)
@@ -44,6 +44,9 @@ class Talisman(
.build() .build()
} }
val itemStack: ItemStack
get() = _itemStack.clone()
val craftable = config.getBool("craftable") val craftable = config.getBool("craftable")
val recipe: CraftingRecipe? = run { val recipe: CraftingRecipe? = run {