mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Add BiomeDictionary#hasType(String) (#8157)
This commit is contained in:
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.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user