mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-26 20:27:38 +01:00
Added option for soulbound to be 1-time use
This commit is contained in:
parent
dd9181f615
commit
df2191f0e7
@ -75,6 +75,14 @@ public class Soulbound extends EcoEnchant {
|
||||
assert meta != null;
|
||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||
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);
|
||||
}
|
||||
meta.removeEnchant(this);
|
||||
}
|
||||
|
||||
itemStack.setItemMeta(meta);
|
||||
}
|
||||
|
||||
|
@ -20,4 +20,4 @@ general-config:
|
||||
conflicts: []
|
||||
|
||||
config:
|
||||
# No config is available for this enchantment
|
||||
remove-after: false # If soulbound should be 1-time use
|
Loading…
Reference in New Issue
Block a user