Skip to content

Commit

Permalink
Use tool name format for tooltparts (#4753)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Jan 19, 2023
1 parent 6979fbb commit 8bd4505
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
/** Helper functions for adding tooltips to tools */
public class TooltipUtil {
/** Translation key for the tool name format string */
private static final String KEY_FORMAT = TConstruct.makeTranslationKey("item", "tool.format");
public static final String KEY_FORMAT = TConstruct.makeTranslationKey("item", "tool.format");
/** Translation key for the tool name format string */
private static final Component MATERIAL_SEPARATOR = TConstruct.makeTranslation("item", "tool.material_separator");
/** Tool tag to set that makes a tool a display tool */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import slimeknights.tconstruct.library.materials.definition.IMaterial;
import slimeknights.tconstruct.library.materials.definition.MaterialId;
import slimeknights.tconstruct.library.materials.definition.MaterialVariantId;
import slimeknights.tconstruct.library.tools.helper.TooltipUtil;
import slimeknights.tconstruct.library.utils.DomainDisplayName;
import slimeknights.tconstruct.library.utils.NBTTags;
import slimeknights.tconstruct.library.utils.Util;
Expand Down Expand Up @@ -98,7 +99,7 @@ private static Component getName(String baseKey, MaterialVariantId material) {
}
// format as "<material> <item name>"
if (Util.canTranslate(materialKey)) {
return new TranslatableComponent(materialKey).append(" ").append(new TranslatableComponent(baseKey));
return new TranslatableComponent(TooltipUtil.KEY_FORMAT, new TranslatableComponent(materialKey), new TranslatableComponent(baseKey));
}
return null;
}
Expand Down

0 comments on commit 8bd4505

Please sign in to comment.