Skip to content

Commit

Permalink
Merge pull request #115 from YuRaNnNzZZ/1.12-enchanttooltiptoggle
Browse files Browse the repository at this point in the history
Allow to disable enchantment descriptions with a config option.
  • Loading branch information
HenryLoenwind authored Mar 7, 2021
2 parents 07a280c + 1de8186 commit 36f18cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,6 +18,10 @@ public class EnchantTooltipHandler {

@SubscribeEvent
public static void handleTooltip(ItemTooltipEvent event) {
if (!ConfigHandler.showEnchantmentTooltips) {
return;
}

if (event.getItemStack().hasTagCompound()) {
Map<Enchantment, Integer> enchantments = EnchantmentHelper.getEnchantments(event.getItemStack());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 36f18cd

Please sign in to comment.