Skip to content

Commit

Permalink
⚡ Improve tooltips to better highlight positive perks
Browse files Browse the repository at this point in the history
  • Loading branch information
Autovw committed Nov 19, 2024
1 parent 7d5fa59 commit 30edb52
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
25 changes: 13 additions & 12 deletions Common/src/main/resources/assets/advancednetherite/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 30edb52

Please sign in to comment.