From c0eadf6959fadd4609f5aeb5b5d9e25295aacf14 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 22 Oct 2023 14:43:03 +0100 Subject: [PATCH] Soulbound now uses a native paper API --- .../ecoenchants/enchants/impl/EnchantmentSoulbound.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentSoulbound.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentSoulbound.kt index 33576b0c..e63a264e 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentSoulbound.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentSoulbound.kt @@ -1,6 +1,7 @@ package com.willfp.ecoenchants.enchants.impl import com.willfp.eco.core.EcoPlugin +import com.willfp.eco.core.Prerequisite import com.willfp.eco.core.data.keys.PersistentDataKey import com.willfp.eco.core.data.keys.PersistentDataKeyType import com.willfp.eco.core.data.profile @@ -80,6 +81,12 @@ class EnchantmentSoulbound( event.drops.removeAll(items) + // Use native paper method + if (Prerequisite.HAS_PAPER.isMet) { + event.itemsToKeep += items + return + } + for (item in items) { item.fast().persistentDataContainer.set(soulboundKey, PersistentDataType.INTEGER, 1)