mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-19 05:01:40 +01:00
Fixed single-use soulbound on paper
This commit is contained in:
parent
9acd9c9b8b
commit
02961de74f
@ -69,7 +69,18 @@ class EnchantmentSoulbound(
|
||||
|
||||
// Use native paper method
|
||||
if (Prerequisite.HAS_PAPER.isMet) {
|
||||
event.itemsToKeep += items
|
||||
val modifiedItems = if (enchant.config.getBool("single-use")) {
|
||||
items.map {
|
||||
val meta = it.itemMeta
|
||||
meta.removeEnchant(enchant.enchantment)
|
||||
it.itemMeta = meta
|
||||
it
|
||||
}
|
||||
} else {
|
||||
items
|
||||
}
|
||||
|
||||
event.itemsToKeep += modifiedItems
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user