Fixed single-use soulbound on paper

This commit is contained in:
Will FP 2024-05-11 17:21:51 +01:00
parent 9acd9c9b8b
commit 02961de74f

View File

@ -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
}