From 1de81869ade3a2d4027aa903712174702ffdd2f9 Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Wed, 7 Aug 2019 21:39:03 +0300 Subject: [PATCH] Allow to disable enchantment descriptions with a config option. --- .../enderio/core/client/handlers/EnchantTooltipHandler.java | 5 +++++ .../java/com/enderio/core/common/config/ConfigHandler.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/com/enderio/core/client/handlers/EnchantTooltipHandler.java b/src/main/java/com/enderio/core/client/handlers/EnchantTooltipHandler.java index f8165960..dce9872b 100644 --- a/src/main/java/com/enderio/core/client/handlers/EnchantTooltipHandler.java +++ b/src/main/java/com/enderio/core/client/handlers/EnchantTooltipHandler.java @@ -6,6 +6,7 @@ import com.enderio.core.api.common.enchant.IAdvancedEnchant; import com.enderio.core.common.Handlers.Handler; +import com.enderio.core.common.config.ConfigHandler; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.util.text.TextFormatting; @@ -17,6 +18,10 @@ public class EnchantTooltipHandler { @SubscribeEvent public static void handleTooltip(ItemTooltipEvent event) { + if (!ConfigHandler.showEnchantmentTooltips) { + return; + } + if (event.getItemStack().hasTagCompound()) { Map enchantments = EnchantmentHelper.getEnchantments(event.getItemStack()); diff --git a/src/main/java/com/enderio/core/common/config/ConfigHandler.java b/src/main/java/com/enderio/core/common/config/ConfigHandler.java index beee79f3..c06dfb47 100644 --- a/src/main/java/com/enderio/core/common/config/ConfigHandler.java +++ b/src/main/java/com/enderio/core/common/config/ConfigHandler.java @@ -66,6 +66,11 @@ public class ConfigHandler extends AbstractConfigHandler implements ITweakConfig @NoSync public static int showDurabilityTooltips = 1; + @Config + @Comment("Show description for enchantments in tooltips.") + @NoSync + public static boolean showEnchantmentTooltips = true; + @Config @Comment("The way the game should have been made (Yes this is the fireworks thing).") public static boolean betterAchievements = false;