mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-09 16:47:36 +01:00
Fix passing Material enum strings directly to getShortenedName
This commit is contained in:
parent
173991ab4a
commit
12d2107ce1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user