Skip to content

Commit

Permalink
Add localization for king slime tools
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 22, 2014
1 parent 2a2cf76 commit d2681d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -844,3 +844,7 @@ tool.arrow=Arrow

# Customization of default tool names based on tool and material
#tool.shovel.wood=Wooden Shovel

tool.kingslimeprefix=King Slime
# Specific localization like materials
#tool.shovel.kingslime=Regret
10 changes: 9 additions & 1 deletion src/main/java/tconstruct/world/entity/BlueSlime.java
Expand Up @@ -462,7 +462,15 @@ protected void dropFewItems (boolean par1, int par2)
final ItemStack handleStack = new ItemStack(tool.getHandleItem(), 1, 17);
final ItemStack accessoryStack = tool.getAccessoryItem() != null ? new ItemStack(tool.getAccessoryItem(), 1, 17) : null;
final ItemStack extraStack = tool.getExtraItem() != null ? new ItemStack(tool.getExtraItem(), 1, 17) : null;
ItemStack toolStack = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, extraStack, "King Slime " + tool.getLocalizedToolName());

String loc = "tool." + tool.getToolName().toLowerCase() + ".kingslime"; // special localization the same way as materials
String name;
if(StatCollector.canTranslate(loc))
name = StatCollector.translateToLocal(loc);
else
name = StatCollector.translateToLocal("tool.kingslimeprefix") + " " + tool.getLocalizedToolName();

ItemStack toolStack = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, extraStack, name);

if (toolStack != null)
{
Expand Down

0 comments on commit d2681d1

Please sign in to comment.