Class JsonPatch
- Namespace
- Vintagestory.ServerMods.NoObf
- Assembly
- VSEssentials.dll
Defines a patch for a json asset. This allows modifying json files through mods without directly editing them. To help with creating patches, it is highly recommended to learn how to use the in-built modmaker program. See https://wiki.vintagestory.at/Modding:Inbuilt_ModMaker for more info.
public class JsonPatch
- Inheritance
-
JsonPatch
Fields
File (Required)
The asset location of the file where the patch should be applied.
public AssetLocation File
Field Value
Op (Required)
The operation for the patch. Essentially controls what the patch actually does.
public EnumJsonPatchOp Op
Field Value
Path (Required)
This is the path to the json property where the operation will take place.
public string Path
Field Value
Value (Recommended) (Default: None)
If adding, this is the value (or values) that will be added.
[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject Value
Field Value
Condition (Optional) (Default: None)
A condition that this patch must satisfy to be applied. Uses specific values from the world config. Useful in conjunction with code mods.
public PatchCondition Condition
Field Value
DependsOn (Optional) (Default: None)
A list of mod dependencies for the patch. Can be used to create patches that are specific on certain mods being installed. Useful for compatibility!
public PatchModDependence[] DependsOn
Field Value
Enabled (Optional) (Default: True)
Should this patch be applied or not?
public bool Enabled
Field Value
FromPath (Optional)
public string FromPath
Field Value
Side (Optional) (Default: Universal)
The app side that the patch should be loaded on.
public EnumAppSide? Side
Field Value
Properties
SideType (Obsolete)
The app side that the patch should be loaded on. Obsolete, please use Side instead.
[Obsolete("Use Side instead")]
public EnumAppSide? SideType { get; set; }