mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Merge pull request #1723 from Vexatos/patch-1
Fix a crash with dynamically generated tool parts (bolts) trying to get a material name shorter than 9 characters.
This commit is contained in:
commit
84bb51d365
1 file changed
+2
-1
@@ -19,6 +19,7 @@ import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class DynamicToolPart extends CraftingItem implements IToolPart
|
||||
@@ -85,7 +86,7 @@ public class DynamicToolPart extends CraftingItem implements IToolPart
|
||||
if(toolmat == null)
|
||||
return super.getItemStackDisplayName(stack);
|
||||
|
||||
material = toolmat.localizationString.substring(9); // :(
|
||||
material = toolmat.localizationString.toLowerCase(Locale.ENGLISH).startsWith("material.") ? toolmat.localizationString.substring(9) : toolmat.localizationString; // :(
|
||||
matName = toolmat.prefixName();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user