From d49018bbe478cbad21a0786ecbb0598129caeb88 Mon Sep 17 00:00:00 2001 From: XPYEX Date: Thu, 3 Oct 2024 01:41:53 +0800 Subject: [PATCH] docs: javadoc --- .../ch/njol/skript/bukkitutil/BukkitUnsafe.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java b/src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java index fd11c49cdb1..30c9fe11dd9 100644 --- a/src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java +++ b/src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java @@ -65,12 +65,26 @@ public class BukkitUnsafe { @Nullable private static Map idMappings; + /** + * @deprecated You should use {@link BukkitUnsafe#getMaterialFromNamespacedId(String)} + * Get a material from a minecraft id. + * + * @param id Namespaced id (just like 'minecraft:dirt'), or normally just a material name (just like 'dirt') + * @return Material or null + */ @Nullable @Deprecated public static Material getMaterialFromMinecraftId(String id) { return getMaterialFromNamespacedId(id); } + /** + * Get a material from a namespaced id. + * Such as, minecraft:iron_ingot -> IRON_INGOT; mod:an_item -> mod_an_item + * + * @param id Namespaced id (just like 'minecraft:dirt'), or normally just a material name (just like 'dirt') + * @return Material or null + */ @Nullable public static Material getMaterialFromNamespacedId(String id) { return Material.matchMaterial(id.toLowerCase().startsWith(NamespacedKey.MINECRAFT + ":")