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. Open in GitHub
[DocumentAsJson]
public class JsonPatch
- Inheritance
-
JsonPatch
Fields
File (Required)
The asset location of the file where the patch should be applied.
[DocumentAsJson]
public AssetLocation File
Field Value
Op (Required)
The operation for the patch. Essentially controls what the patch actually does.
[DocumentAsJson]
public EnumJsonPatchOp Op
Field Value
Path (Required)
This is the path to the json property where the operation will take place.
[DocumentAsJson]
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.
[DocumentAsJson]
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!
[DocumentAsJson]
public PatchModDependence[] DependsOn
Field Value
Enabled (Optional) (Default: True)
Should this patch be applied or not?
[DocumentAsJson]
public bool Enabled
Field Value
FromPath (Optional)
[DocumentAsJson]
public string FromPath
Field Value
Side (Optional) (Default: Universal)
The app side that the patch should be loaded on.
[DocumentAsJson]
public EnumAppSide? Side
Field Value
SideType (Obsolete)
The app side that the patch should be loaded on. Obsolete, please use Side instead.
[Obsolete("Use Side instead")]
[DocumentAsJson]
public EnumAppSide? SideType { get; set; }