mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-24 05:54:34 +00:00
Feature #954: Custom names for specific toolpart and material combinations and tool default names
This commit is contained in:
1 parent
593af6be17
commit
7ae5a92a8f
3 files changed
+31
-19
No files matched your search
@@ -2,9 +2,12 @@ package tconstruct.library.crafting;
|
||||
|
||||
/** Once upon a time, too many tools to count. Let's put them together automatically */
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.event.*;
|
||||
@@ -428,6 +431,14 @@ public class ToolBuilder
|
||||
|
||||
public static String defaultToolName (ToolMaterial headMat, ToolCore tool)
|
||||
{
|
||||
String toolName = tool.getToolName().toLowerCase();
|
||||
String matName = headMat.materialName.toLowerCase().replaceAll(" ", "");
|
||||
|
||||
if (StatCollector.canTranslate("tool." + toolName + "." + matName))
|
||||
{
|
||||
return StatCollector.translateToLocal("tool." + toolName + "." + matName);
|
||||
}
|
||||
|
||||
return String.format("%s %s", headMat.prefixName(), tool.getLocalizedToolName());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user