mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Fixed strange issue related to item meta.
Added more verbose debug log.
This commit is contained in:
parent
1eac81aef6
commit
c7fee98d44
6 changed files with 23 additions and 21 deletions
|
|
@ -29,13 +29,11 @@ object ItemUtil {
|
|||
fun ItemStack.setEnchantmentsUnsafe(enchantments: Map<WrappedEnchantment, Int>) {
|
||||
WrappedEnchantment.clearEnchants(this)
|
||||
|
||||
val meta = this.itemMeta ?: return
|
||||
|
||||
//TODO maybe faster methode to add vanilla enchantment. maybe move this function to wrapped enchantment
|
||||
enchantments.forEach { (enchantment, level) ->
|
||||
enchantment.addEnchantmentUnsafe(this, meta, level)
|
||||
enchantment.addEnchantmentUnsafe(this, level)
|
||||
}
|
||||
|
||||
this.itemMeta = meta
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue