public class TagRegistry extends Object
| Constructor and Description |
|---|
TagRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static Tag |
createInstance(int id)
Creates an instance of the tag with the given id, using the String constructor.
|
static @Nullable Class<? extends Tag> |
getClassFor(int id)
Gets the tag class with the given id.
|
static int |
getIdFor(Class<? extends Tag> clazz)
Gets the id of the given tag class.
|
static void |
register(int id,
Class<? extends Tag> tag,
Supplier<? extends Tag> supplier)
Registers a tag class.
|
static void |
unregister(int id)
Unregisters a tag class.
|
public static void register(int id,
Class<? extends Tag> tag,
Supplier<? extends Tag> supplier)
throws TagRegisterException
id - ID of the tag.tag - Tag class to register.TagRegisterException - If an error occurs while registering the tag.public static void unregister(int id)
id - ID of the tag to unregister.@Nullable public static @Nullable Class<? extends Tag> getClassFor(int id)
id - Id of the tag.public static int getIdFor(Class<? extends Tag> clazz)
clazz - The tag class to get the id of.public static Tag createInstance(int id) throws TagCreateException
id - Id of the tag.TagCreateException - If an error occurs while creating the tag.Copyright © 2021. All rights reserved.