Skip to content

Commit

Permalink
Fixed material name replacement when %%material is used as a suffix
Browse files Browse the repository at this point in the history
 * ToolMaterial stores display names with a trailing space, so it needs to be trimmed before replacement
 * Fixes comment in issue #7
  • Loading branch information
squeek502 committed Jun 12, 2014
1 parent 222edc0 commit 58f3a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/squeek/tictooltips/TooltipHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ private List<String> getToolPartTooltip(Item itemPart, int matID, ToolCore tool)
{
ToolPart part = (ToolPart) itemPart;
ToolMaterial mat = TConstructRegistry.getMaterial(matID);
toolTip.add(mat.style() + EnumChatFormatting.UNDERLINE + StringHelper.getLocalizedString("toolpart." + part.partName).replaceAll("%%material ", mat.displayName));
toolTip.add(mat.style() + EnumChatFormatting.UNDERLINE + StringHelper.getLocalizedString("toolpart." + part.partName).replaceAll("%%material", mat.displayName.trim()));
}
else if (itemPart instanceof Bowstring)
{
Expand Down

0 comments on commit 58f3a26

Please sign in to comment.