From 13df35a22bb856a255ca3b235e46432f2609f69d Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 15 Apr 2021 18:37:34 +0100 Subject: [PATCH] Added hard disable option --- .../com/willfp/ecoenchants/enchantments/EcoEnchant.java | 5 +++++ eco-core/core-plugin/src/main/resources/config.yml | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java index d7fe0e11..0cf48fd5 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java @@ -162,6 +162,11 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Watche } this.update(); + + if (!this.isEnabled() && this.getPlugin().getConfigYml().getBool("advanced.hard-disable.enabled")) { + return; + } + EcoEnchants.addNewEcoEnchant(this); } diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 2de4088d..fddf263c 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -124,4 +124,9 @@ advanced: aggressive: false # Aggressive mode converts all items in all inventories whenever revealed. # This may impact performance. - force: false # If **all** items should have hide enchants removed - absolute last ditch effort, most likely to break other things. \ No newline at end of file + force: false # If **all** items should have hide enchants removed - absolute last ditch effort, most likely to break other things. + hard-disable: + # Fixes potential problems with other plugins where the enchantments are still present when disabled. + # Enabling this prevents the enchantments from being registered with the server at all when disabled. + # There may be some unknown problems with this, but will fix bugs with plugins such as Slimefun. + enabled: false \ No newline at end of file