Changes

Copy Capabilities/Attaching to MC1.16 archive
Line 10: Line 10:  
In all cases, the event has a method <code>addCapability</code>, which can be used to attach capabilities to the target object. Instead of adding capabilities themselves to the list, you add capability providers, which have the chance to return capabilities only from certain sides. While the provider only needs to implement <code>ICapabilityProvider</code>, if the capability needs to store data persistently it is possible to implement <code><nowiki>ICapabilitySerializable<T extends INBT></nowiki></code> which, on top of returning the capabilities, will allow providing NBT save/load functions.
 
In all cases, the event has a method <code>addCapability</code>, which can be used to attach capabilities to the target object. Instead of adding capabilities themselves to the list, you add capability providers, which have the chance to return capabilities only from certain sides. While the provider only needs to implement <code>ICapabilityProvider</code>, if the capability needs to store data persistently it is possible to implement <code><nowiki>ICapabilitySerializable<T extends INBT></nowiki></code> which, on top of returning the capabilities, will allow providing NBT save/load functions.
   −
For information on how to implement <code>ICapabilityProvider</code>, refer to the [[Capabilities|a Capability/1.16]] section.
+
For information on how to implement <code>ICapabilityProvider</code>, refer to the [[Capabilities/1.16|a Capability]] section.
    
== Creating Your Own Capability ==
 
== Creating Your Own Capability ==
Line 73: Line 73:  
# When a new client starts viewing the entity or block, you may want to notify it of the existing data.
 
# When a new client starts viewing the entity or block, you may want to notify it of the existing data.
   −
Refer to the [[Understanding Networking|Networking/1.16]] page for more information on implementing network packets.
+
Refer to the [[Understanding Networking/1.16|Networking]] page for more information on implementing network packets.
    
== Persisting across Player Deaths ==
 
== Persisting across Player Deaths ==
Line 81: Line 81:       −
[[Category:Data Storage/1.16]]
+
[[Category:Data Storage/1.16|Category:Data Storage]]
372

edits