mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-25 00:01:21 +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
|
* @return The name shortened to the max length
|
||||||
*/
|
*/
|
||||||
public static String getShortenedName(String itemName, int maxWidth) {
|
public static String getShortenedName(String itemName, int maxWidth) {
|
||||||
|
itemName = StringUtil.capitalizeFirstLetter(itemName.replace('_', ' '), ' ');
|
||||||
int width = getMinecraftStringWidth(itemName);
|
int width = getMinecraftStringWidth(itemName);
|
||||||
if (width <= maxWidth) {
|
if (width <= maxWidth) {
|
||||||
return itemName;
|
return itemName;
|
||||||
|
Loading…
Reference in New Issue
Block a user