Add BiomeDictionary#hasType(String) (#8157)

This commit is contained in:
Alex O'Neill authored and GitHub committed 2021-10-20 12:10:13 -07:00
1 parent e431bb1caa
commit 1dc421e6a4
2 files changed
+32

No files matched your search

@@ -156,6 +156,19 @@ public class BiomeDictionary
return t;
}
/**
* Checks if a type instance exists for a given name. Does not have any side effects if a type does not already exist.
* This can be used for checking if a user-defined type is valid, for example, in a codec which accepts biome dictionary names.
* @param name The name.
* @return {@code true} if a type exists with this name.
*
* @see #getType(String, Type...) #getType for type naming conventions.
*/
public static boolean hasType(String name)
{
return byName.containsKey(name.toUpperCase());
}
/**
* @return An unmodifiable collection of all current biome types.
*/