Skip to content

Commit

Permalink
docs: javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
0XPYEX0 committed Oct 2, 2024
1 parent fd28c5c commit d49018b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,26 @@ public class BukkitUnsafe {
@Nullable
private static Map<Integer,Material> 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 + ":")
Expand Down

0 comments on commit d49018b

Please sign in to comment.