Interface ITaggableElementRegistrationHandler
public interface ITaggableElementRegistrationHandler
Manages the registration of taggable elements and their managers used for tags.
Refer to the documentation of the various methods for more information.
- Since:
- 9.1.0
-
Method Summary
Modifier and TypeMethodDescription<T,U extends ITagManager<?>>
voidregisterManager(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, TagManagerFactory<T, U> factory) Registers a newTagManagerFactoryfor the givenResourceKey.<T> voidregisterTaggableElement(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<T> elementClass) Registers a new taggable element with the givenResourceKeyof theRegistrythat holds the given element class.
-
Method Details
-
registerTaggableElement
<T> void registerTaggableElement(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<T> elementClass) Registers a new taggable element with the givenResourceKeyof theRegistrythat holds the given element class.The key is used to map
<tag:>calls to the specific element.- Type Parameters:
T- The type of element being registered.- Parameters:
key- TheResourceKeyof the Registry that holds the element is being registered.elementClass- AClassof the element that is being registered.- Since:
- 9.1.0
-
registerManager
<T,U extends ITagManager<?>> void registerManager(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, TagManagerFactory<T, U> factory) Registers a newTagManagerFactoryfor the givenResourceKey.A tag manager factory allows for a custom class to be used instead of the default
KnownTagManager. A custom tag manager allows you to easily add new methods to your manager without having to expand it.Note: Taggable elements with type parameters require a custom factory, see
EntityTypeTagManagerFactoryandEntityTypeTagManager.- Type Parameters:
T- The type of element the tagmanager the factory makes deals with.- Parameters:
key- TheResourceKeyof the Registry that holds the element is being registered.factory- TheTagManagerFactorythat is being registered.- Since:
- 9.1.0
-