Fix passing Material enum strings directly to getShortenedName

This commit is contained in:
Phoenix616 2018-09-09 23:08:49 +01:00
parent 173991ab4a
commit 12d2107ce1

View File

@ -238,6 +238,7 @@ public class MaterialUtil {
* @return The name shortened to the max length
*/
public static String getShortenedName(String itemName, int maxWidth) {
itemName = StringUtil.capitalizeFirstLetter(itemName.replace('_', ' '), ' ');
int width = getMinecraftStringWidth(itemName);
if (width <= maxWidth) {
return itemName;