Changes

26 bytes added ,  16:44, 13 August 2022
m
fix italics markup
Line 40: Line 40:  
* A datapack registry json is loaded that refers to another registrable by id, e.g. "minecraft:desert"
 
* A datapack registry json is loaded that refers to another registrable by id, e.g. "minecraft:desert"
 
* A standalone reference holder is retrieved from the relevant registry via a get-or-create operation
 
* A standalone reference holder is retrieved from the relevant registry via a get-or-create operation
* When a datapack registry json is loaded and fully parsed, a holder for that json is get-or-created *and* the parsed value is bound to it
+
* When a datapack registry json is loaded and fully parsed, a holder for that json is get-or-created ''and'' the parsed value is bound to it
 
* When registries freeze, the get-or-create operation can no longer create new holders. If any reference holders in the registry are not fully bound at this time (with both a key and a value), an error is raised. This will occur if a datapack registry json refers by id to another datapack registry json that does not exist, and is how these references-by-id are validated.
 
* When registries freeze, the get-or-create operation can no longer create new holders. If any reference holders in the registry are not fully bound at this time (with both a key and a value), an error is raised. This will occur if a datapack registry json refers by id to another datapack registry json that does not exist, and is how these references-by-id are validated.
 
* Whenever tags load, each tag file's TagKey is bound to all reference holders referred to in that tag (this modifiers the holders in-place).
 
* Whenever tags load, each tag file's TagKey is bound to all reference holders referred to in that tag (this modifiers the holders in-place).
   −
When datagenerating datapack registry jsons with reference holders, any reference holders *must* be created by the specific registry instances used by the RegistryOps/RegistryAccess used to datagen the jsons, or they will fail to serialize.
+
When datagenerating datapack registry jsons with reference holders, any reference holders ''must'' be created by the specific registry instances used by the RegistryOps/RegistryAccess used to datagen the jsons, or they will fail to serialize.
    
===== Intrusive Reference Holders =====
 
===== Intrusive Reference Holders =====
Line 102: Line 102:  
Forge expands the holderset codecs to allow additional json formats. Custom holderset serializers can be registered by creating a deferred register for ForgeRegistries.Keys.HOLDER_SET_TYPES, though the builtin types provided by forge should be sufficient for most use cases.
 
Forge expands the holderset codecs to allow additional json formats. Custom holderset serializers can be registered by creating a deferred register for ForgeRegistries.Keys.HOLDER_SET_TYPES, though the builtin types provided by forge should be sufficient for most use cases.
   −
==== Builtin Custom HolderSet Types ====
+
====Builtin Custom HolderSet Types====
 
+
Forge provides four builtin holderset types, allowing for additional set operations and representations in datapack registry jsons. The <code>and</code>, <code>or</code>,  
Forge provides four builtin holderset types, allowing for additional set operations and representations in datapack registry jsons. The and, or, and not types are composed of other holdersets, and are therefore potentially mutable as they may be composed of mutable tag holdersets whose values are recalculated after tags reload.
+
and <code>not</code> types are composed of other holdersets, and are therefore potentially mutable as they may be composed of mutable tag holdersets whose values are recalculated after tags reload.
 
+
=====Any=====
===== Any =====
  −
 
   
The <code>forge:any</code> holderset type represents the set of all elements of the relevant registry.
 
The <code>forge:any</code> holderset type represents the set of all elements of the relevant registry.
   Line 120: Line 118:       −
===== And =====
+
=====And=====
 
   
The <code>forge:and</code> type represents an intersection of other holdersets.
 
The <code>forge:and</code> type represents an intersection of other holdersets.
   Line 138: Line 135:  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
=====Or=====
===== Or =====
  −
 
   
The <code>forge:or</code> type represents a union of other holdersets.
 
The <code>forge:or</code> type represents a union of other holdersets.
   Line 157: Line 152:  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
=====Not=====
===== Not =====
  −
 
   
The <code>forge:not</code> type represents the set of all elements in the registry that do not belong to the specified holderset.
 
The <code>forge:not</code> type represents the set of all elements in the registry that do not belong to the specified holderset.
  
22

edits