Changes

7 bytes added ,  13:27, 22 March 2022
add missing code tag end
Line 29: Line 29:  
Tags for all registries are automatically sent from the server to any remote clients on login and reload. <code><nowiki>Block</nowiki></code>s, <code><nowiki>Item</nowiki></code>s, <code><nowiki>EntityType</nowiki></code>s, <code><nowiki>Fluid</nowiki></code>s, and <code><nowiki>GameEvent</nowiki></code>s are special cased as they have <code><nowiki>Holder</nowiki></code>s allowing for available tags to be accessible through the object itself.
 
Tags for all registries are automatically sent from the server to any remote clients on login and reload. <code><nowiki>Block</nowiki></code>s, <code><nowiki>Item</nowiki></code>s, <code><nowiki>EntityType</nowiki></code>s, <code><nowiki>Fluid</nowiki></code>s, and <code><nowiki>GameEvent</nowiki></code>s are special cased as they have <code><nowiki>Holder</nowiki></code>s allowing for available tags to be accessible through the object itself.
   −
Tags wrappers can be created using <code><nowiki>TagKey#create</nowiki></code> where the registry the tag should belong to and the tag name are supplied. Some vanilla defined helpers are also available to create wrappers via <code><nowiki>*Tags#create</nowiki></code> where <code><nowiki>*</nowiki></code> refers to the name of the registry object. Forge wrapped registries can create a tag using <code><nowiki>ITagManager</nowiki></code> via <code><nowiki>IForgeRegistry#tags</nowiki></code>. <code><nowiki>TagKey</nowiki></code>s can then be obtained via <code><nowiki>ITagManager#createTagKey</nowiki>.
+
Tags wrappers can be created using <code><nowiki>TagKey#create</nowiki></code> where the registry the tag should belong to and the tag name are supplied. Some vanilla defined helpers are also available to create wrappers via <code><nowiki>*Tags#create</nowiki></code> where <code><nowiki>*</nowiki></code> refers to the name of the registry object. Forge wrapped registries can create a tag using <code><nowiki>ITagManager</nowiki></code> via <code><nowiki>IForgeRegistry#tags</nowiki></code>. <code><nowiki>TagKey</nowiki></code>s can then be obtained via <code><nowiki>ITagManager#createTagKey</nowiki></code>.
    
Forge wrapped registry objects can grab their associated holder using <code><nowiki>IForgeRegistry#getHolder</nowiki></code>. Additionally, other streamlined operations can be performed using <code><nowiki>ITagManager</nowiki></code>. Non-Forge registry objects use either <code><nowiki>Registry#getHolder</nowiki></code> or <code><nowiki>Registry#getHolderOrThrow</nowiki></code> to get the current holder.
 
Forge wrapped registry objects can grab their associated holder using <code><nowiki>IForgeRegistry#getHolder</nowiki></code>. Additionally, other streamlined operations can be performed using <code><nowiki>ITagManager</nowiki></code>. Non-Forge registry objects use either <code><nowiki>Registry#getHolder</nowiki></code> or <code><nowiki>Registry#getHolderOrThrow</nowiki></code> to get the current holder.