Skip to content

Commit

Permalink
Fix naming of individual materials
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Feb 11, 2025
1 parent 5f8aeba commit f6ae07a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/world/bentobox/challenges/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ public static <T extends Enum<T>> String prettifyObject(@Nullable T object, User
if (object == null) {
return "";
}
if (object instanceof Material m) {
return prettifyMaterial(m, user);
}
// Build a translation key using the enum name.
String translation = user
.getTranslationOrNothing(Constants.MATERIALS + object.name().toLowerCase(Locale.ENGLISH) + ".name");
Expand All @@ -331,7 +334,7 @@ public static <T extends Enum<T>> String prettifyObject(@Nullable T object, User
* @param user User who will see the object.
* @return Prettified string for Material.
*/
public static String prettifyObject(@Nullable Material object, User user)
public static String prettifyMaterial(@Nullable Material object, User user)
{
// Nothing to translate
if (object == null)
Expand Down

0 comments on commit f6ae07a

Please sign in to comment.