Modding:JSON Patching: Difference between revisions

From Vintage Story Wiki
Added an example for using "side" property. Needs validating from coders.
(Marked this version for translation)
(Added an example for using "side" property. Needs validating from coders.)
Line 101: Line 101:
<!--T:23-->
<!--T:23-->
For the value, there is an entire section showing that the value doesn't just have to be a number or text. In this case, we added the stick to the drops but by specifying a domain in front of stick like we do for the file it could be a stick from any mod!
For the value, there is an entire section showing that the value doesn't just have to be a number or text. In this case, we added the stick to the drops but by specifying a domain in front of stick like we do for the file it could be a stick from any mod!


=== Disabling Assets === <!--T:24-->
=== Disabling Assets === <!--T:24-->
Line 115: Line 113:
That's all you have to do. If there's already an enabled label in the file then we'd need to switch op from add to replace.
That's all you have to do. If there's already an enabled label in the file then we'd need to switch op from add to replace.


=== Targeting server or client assets ===
If you know that a target JSON file is only applied on the server or client, you can use the attribute "side" with the appropriate value to avoid unnecessary processing and the accompanying warnings in log files such as "''Hint: This asset is usually only loaded Server side''". For example, a cooking recipe will only be loaded by the server and you could therefore add the attribute :
<syntaxhighlight lang="json">
"server": "side"
</syntaxhighlight>
so the client doesn't try to patch anything.


=== File Path and Name Considerations === <!--T:28-->
=== File Path and Name Considerations === <!--T:28-->
Confirmedusers
957

edits