Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable enchantment descriptions with a config option. #115

Merged
merged 1 commit into from
Mar 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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