diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java index a29fc2c8..89aa8f59 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java @@ -63,8 +63,10 @@ public class Soulbound extends EcoEnchant { soulboundItems.add(itemStack); } - if (itemStack.getItemMeta() instanceof EnchantmentStorageMeta && (((EnchantmentStorageMeta) itemStack.getItemMeta()).getStoredEnchants().containsKey(this.getEnchantment()))) { - soulboundItems.add(itemStack); + if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "on-books")) { + if (itemStack.getItemMeta() instanceof EnchantmentStorageMeta && (((EnchantmentStorageMeta) itemStack.getItemMeta()).getStoredEnchants().containsKey(this.getEnchantment()))) { + soulboundItems.add(itemStack); + } } } @@ -77,8 +79,10 @@ public class Soulbound extends EcoEnchant { container.set(this.getPlugin().getNamespacedKeyFactory().create("soulbound"), PersistentDataType.INTEGER, 1); if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "remove-after")) { - if (meta instanceof EnchantmentStorageMeta) { - ((EnchantmentStorageMeta) meta).removeStoredEnchant(this); + if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "on-books")) { + if (meta instanceof EnchantmentStorageMeta) { + ((EnchantmentStorageMeta) meta).removeStoredEnchant(this); + } } meta.removeEnchant(this); } diff --git a/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml b/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml index bf38f4c2..aec3502e 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml @@ -20,4 +20,5 @@ general-config: conflicts: [ ] config: - remove-after: false # If soulbound should be 1-time use \ No newline at end of file + remove-after: false # If soulbound should be 1-time use + on-books: true # If soulbound should work on books \ No newline at end of file