From 753956d04926afe36f6d607400a0fd8691ce8846 Mon Sep 17 00:00:00 2001 From: MelonCode Date: Thu, 15 Sep 2022 03:04:24 +0300 Subject: [PATCH] Add an option to disable display module completely --- .../main/kotlin/com/willfp/ecoenchants/EcoEnchantsPlugin.kt | 5 ++++- eco-core/core-plugin/src/main/resources/config.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/EcoEnchantsPlugin.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/EcoEnchantsPlugin.kt index 9631bd4f..5969a570 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/EcoEnchantsPlugin.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/EcoEnchantsPlugin.kt @@ -86,7 +86,10 @@ class EcoEnchantsPlugin : LibReforgePlugin() { ) } - override fun createDisplayModule(): DisplayModule { + override fun createDisplayModule(): DisplayModule? { + if (configYml.getBoolOrNull("display.enabled") == false) { + return null + } return EnchantDisplay(this) } diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 69b7d8e1..ec6c68b6 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -31,6 +31,8 @@ anvil: # Options for how enchantments are displayed on items display: + enabled: true # Setting this to false will disable all visual item modifications + numerals: enabled: true # If numerals should be used for the enchantment levels threshold: 10 # Above this, numbers will be used instead of numerals