mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-26 20:27:38 +01:00
Added on-books for soulbound
This commit is contained in:
parent
56bbc56a6f
commit
3c8b39d7ac
@ -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);
|
||||
}
|
||||
|
@ -20,4 +20,5 @@ general-config:
|
||||
conflicts: [ ]
|
||||
|
||||
config:
|
||||
remove-after: false # If soulbound should be 1-time use
|
||||
remove-after: false # If soulbound should be 1-time use
|
||||
on-books: true # If soulbound should work on books
|
Loading…
Reference in New Issue
Block a user