diff --git a/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleMaterial.java b/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleMaterial.java index 8988a588..3b6813d0 100644 --- a/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleMaterial.java +++ b/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleMaterial.java @@ -15,10 +15,14 @@ import java.util.Optional; public class CompatibleMaterial { public static Optional getMaterial(@NotNull Material material) { - return XMaterial.matchXMaterial(material.name()); + return getMaterial(material.name()); } - public static Optional getMaterial(@NotNull String name) { + public static Optional getMaterial(String name) { + if (name == null || name.isEmpty()) { + return Optional.empty(); + } + return XMaterial.matchXMaterial(name); }