From 3d9a3a15228a21794c3116c2067ea2310d3b5168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rodrigues?= Date: Mon, 28 Oct 2024 18:31:43 +0000 Subject: [PATCH] Fix for getting name of null materials --- .../src/main/java/joserodpt/realmines/api/utils/Text.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/realmines-api/src/main/java/joserodpt/realmines/api/utils/Text.java b/realmines-api/src/main/java/joserodpt/realmines/api/utils/Text.java index 8fe6f12..d180b79 100644 --- a/realmines-api/src/main/java/joserodpt/realmines/api/utils/Text.java +++ b/realmines-api/src/main/java/joserodpt/realmines/api/utils/Text.java @@ -60,6 +60,10 @@ public static String formatNumber(double number) { } public static String beautifyMaterialName(Material m) { + if (m == null) { + return "Unknown"; + } + String[] parts = m.name().split("_"); StringBuilder formattedString = new StringBuilder();