From 30edb52a848f8f3e84791eb4e3ee8daa60742ef0 Mon Sep 17 00:00:00 2001 From: Autovw <68228006+Autovw@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:08:11 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Improve=20tooltips=20to=20better=20?= =?UTF-8?q?highlight=20positive=20perks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/util/ModTooltips.java | 36 +++++++++++-------- .../assets/advancednetherite/lang/en_us.json | 25 ++++++------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/Common/src/main/java/com/autovw/advancednetherite/core/util/ModTooltips.java b/Common/src/main/java/com/autovw/advancednetherite/core/util/ModTooltips.java index 2437ec15..dc0cf56c 100644 --- a/Common/src/main/java/com/autovw/advancednetherite/core/util/ModTooltips.java +++ b/Common/src/main/java/com/autovw/advancednetherite/core/util/ModTooltips.java @@ -12,28 +12,34 @@ */ public final class ModTooltips { + /* Misc */ + private static final MutableComponent PLUS_TOOLTIP = TooltipBuilder.create(id("misc.plus")).withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD); + private static final MutableComponent SHIFT_TOOLTIP = TooltipBuilder.create(id("misc.shift")).withStyle(ChatFormatting.YELLOW); + public static final MutableComponent SHIFT_KEY_TOOLTIP = TooltipBuilder.create(id("misc.press_shift_key"), SHIFT_TOOLTIP); + /* Armor related tooltips */ - public static final MutableComponent ENDERMAN_PASSIVE_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "armor.enderman_passive")).withStyle(ChatFormatting.DARK_GREEN); - public static final MutableComponent PIGLIN_PASSIVE_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "armor.piglin_passive")).withStyle(ChatFormatting.GOLD); - public static final MutableComponent PHANTOM_PASSIVE_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "armor.phantom_passive")).withStyle(ChatFormatting.GRAY); + public static final MutableComponent ENDERMAN_PASSIVE_TOOLTIP = TooltipBuilder.create(id("armor.enderman_passive"), PLUS_TOOLTIP).withStyle(ChatFormatting.DARK_GREEN); + public static final MutableComponent PIGLIN_PASSIVE_TOOLTIP = TooltipBuilder.create(id("armor.piglin_passive"), PLUS_TOOLTIP).withStyle(ChatFormatting.GOLD); + public static final MutableComponent PHANTOM_PASSIVE_TOOLTIP = TooltipBuilder.create(id("armor.phantom_passive"), PLUS_TOOLTIP).withStyle(ChatFormatting.GRAY); /* Tool related tooltips */ // Hoes - public static final MutableComponent ADDITIONAL_CROP_DROPS_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "hoe.additional_crop_drops")); + public static final MutableComponent ADDITIONAL_CROP_DROPS_TOOLTIP = TooltipBuilder.create(id("hoe.additional_crop_drops"), PLUS_TOOLTIP); // Pickaxes - public static final MutableComponent DIAMOND_ORE_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "pickaxe.additional_diamond_drop")).withStyle(ChatFormatting.AQUA); - public static final MutableComponent EMERALD_ORE_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "pickaxe.additional_emerald_drop")).withStyle(ChatFormatting.DARK_GREEN); - public static final MutableComponent GOLD_ORE_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "pickaxe.additional_gold_drop")).withStyle(ChatFormatting.GOLD); - public static final MutableComponent IRON_ORE_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "pickaxe.additional_iron_drop")).withStyle(ChatFormatting.GRAY); + public static final MutableComponent DIAMOND_ORE_DROP_TOOLTIP = TooltipBuilder.create(id("pickaxe.additional_diamond_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.AQUA); + public static final MutableComponent EMERALD_ORE_DROP_TOOLTIP = TooltipBuilder.create(id("pickaxe.additional_emerald_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.DARK_GREEN); + public static final MutableComponent GOLD_ORE_DROP_TOOLTIP = TooltipBuilder.create(id("pickaxe.additional_gold_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GOLD); + public static final MutableComponent IRON_ORE_DROP_TOOLTIP = TooltipBuilder.create(id("pickaxe.additional_iron_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GRAY); // Swords - public static final MutableComponent ENDERMAN_MOB_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "sword.additional_enderman_mob_drop")).withStyle(ChatFormatting.DARK_GREEN); - public static final MutableComponent PIGLIN_MOB_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "sword.additional_piglin_mob_drop")).withStyle(ChatFormatting.GOLD); - public static final MutableComponent ZOMBIFIED_PIGLIN_MOB_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "sword.additional_zombified_piglin_mob_drop")).withStyle(ChatFormatting.GOLD); - public static final MutableComponent PHANTOM_MOB_DROP_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "sword.additional_phantom_mob_drop")).withStyle(ChatFormatting.GRAY); + public static final MutableComponent ENDERMAN_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_enderman_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.DARK_GREEN); + public static final MutableComponent PIGLIN_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_piglin_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GOLD); + public static final MutableComponent ZOMBIFIED_PIGLIN_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_zombified_piglin_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GOLD); + public static final MutableComponent PHANTOM_MOB_DROP_TOOLTIP = TooltipBuilder.create(id("sword.additional_phantom_mob_drop"), PLUS_TOOLTIP).withStyle(ChatFormatting.GRAY); - /* Misc */ - private static final MutableComponent SHIFT_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "misc.shift")).withStyle(ChatFormatting.YELLOW); - public static final MutableComponent SHIFT_KEY_TOOLTIP = TooltipBuilder.create(ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, "misc.press_shift_key"), SHIFT_TOOLTIP); + private static ResourceLocation id(String key) + { + return ResourceLocation.fromNamespaceAndPath(AdvancedNetherite.MOD_ID, key); + } } diff --git a/Common/src/main/resources/assets/advancednetherite/lang/en_us.json b/Common/src/main/resources/assets/advancednetherite/lang/en_us.json index a858d39f..a8c4c219 100644 --- a/Common/src/main/resources/assets/advancednetherite/lang/en_us.json +++ b/Common/src/main/resources/assets/advancednetherite/lang/en_us.json @@ -56,24 +56,25 @@ "itemGroup.advancednetherite.tab": "Advanced Netherite", - "tooltip.advancednetherite.armor.enderman_passive": "+ Pacifies Endermen", - "tooltip.advancednetherite.armor.piglin_passive": "+ Pacifies Piglins", - "tooltip.advancednetherite.armor.phantom_passive": "+ Pacifies Phantoms", + "tooltip.advancednetherite.armor.enderman_passive": "%s Pacifies Endermen", + "tooltip.advancednetherite.armor.piglin_passive": "%s Pacifies Piglins", + "tooltip.advancednetherite.armor.phantom_passive": "%s Pacifies Phantoms", - "tooltip.advancednetherite.hoe.additional_crop_drops": "+ Chance of dropping additional crop drops while harvesting grown crops", + "tooltip.advancednetherite.hoe.additional_crop_drops": "%s Chance of dropping additional crop drops while harvesting grown crops", - "tooltip.advancednetherite.pickaxe.additional_diamond_drop": "+ Chance of dropping additional Diamond while mining Diamond ores", - "tooltip.advancednetherite.pickaxe.additional_emerald_drop": "+ Chance of dropping additional Emerald while mining Emerald ores", - "tooltip.advancednetherite.pickaxe.additional_gold_drop": "+ Chance of dropping additional Raw Gold while mining Gold ores", - "tooltip.advancednetherite.pickaxe.additional_iron_drop": "+ Chance of dropping additional Raw Iron while mining Iron ores", + "tooltip.advancednetherite.pickaxe.additional_diamond_drop": "%s Chance of dropping additional Diamond while mining Diamond ores", + "tooltip.advancednetherite.pickaxe.additional_emerald_drop": "%s Chance of dropping additional Emerald while mining Emerald ores", + "tooltip.advancednetherite.pickaxe.additional_gold_drop": "%s Chance of dropping additional Raw Gold while mining Gold ores", + "tooltip.advancednetherite.pickaxe.additional_iron_drop": "%s Chance of dropping additional Raw Iron while mining Iron ores", - "tooltip.advancednetherite.sword.additional_enderman_mob_drop": "+ Chance of dropping additional Ender Pearl on killing Enderman", - "tooltip.advancednetherite.sword.additional_piglin_mob_drop": "+ Chance of dropping additional Gold Ingot on killing Piglin", - "tooltip.advancednetherite.sword.additional_zombified_piglin_mob_drop": "+ Chance of dropping additional Gold Nugget(s) on killing Zombified Piglin", - "tooltip.advancednetherite.sword.additional_phantom_mob_drop": "+ Chance of dropping additional Phantom Membrane(s) on killing Phantom", + "tooltip.advancednetherite.sword.additional_enderman_mob_drop": "%s Chance of dropping additional Ender Pearl on killing Enderman", + "tooltip.advancednetherite.sword.additional_piglin_mob_drop": "%s Chance of dropping additional Gold Ingot on killing Piglin", + "tooltip.advancednetherite.sword.additional_zombified_piglin_mob_drop": "%s Chance of dropping additional Gold Nugget(s) on killing Zombified Piglin", + "tooltip.advancednetherite.sword.additional_phantom_mob_drop": "%s Chance of dropping additional Phantom Membrane(s) on killing Phantom", "tooltip.advancednetherite.misc.press_shift_key": "Press %s to view all perks", "tooltip.advancednetherite.misc.shift": "[SHIFT]", + "tooltip.advancednetherite.misc.plus": "+", "advancements.advancednetherite.husbandry.netherite_diamond_hoe.title": "Why?", "advancements.advancednetherite.husbandry.netherite_diamond_hoe.description": "Craft a Netherite-Diamond Hoe and visit a psychologist afterwards",