MCPcopy Create free account
hub / github.com/PaperMC/Paper / matchMaterial

Method matchMaterial

paper-api/src/main/java/org/bukkit/Material.java:3063–3066  ·  view source on GitHub ↗

Attempts to match the Material with the given name. This is a match lookup; names will be stripped of the "minecraft:" namespace, converted to uppercase, then stripped of special characters in an attempt to format it like the enum. @param name Name of the material to get @return Material if fou

(@NotNull final String name)

Source from the content-addressed store, hash-verified

3061 * @return Material if found, or null
3062 */
3063 @Nullable
3064 public static Material matchMaterial(@NotNull final String name) {
3065 return matchMaterial(name, false);
3066 }
3067
3068 /**
3069 * Attempts to match the Material with the given name.

Callers 8

matchMaterialByNullMethod · 0.95
matchMaterialByNameMethod · 0.95
matchMaterialByKeyMethod · 0.95
notVersionedMethod · 0.95
matchMaterialMethod · 0.95
getMaterialMethod · 0.95

Calls 3

getMaterialMethod · 0.95
startsWithMethod · 0.80
lengthMethod · 0.45

Tested by 5

matchMaterialByNullMethod · 0.76
matchMaterialByNameMethod · 0.76
matchMaterialByKeyMethod · 0.76