Class SMetadata.Condition
java.lang.Object
net.lcc.sollib.api.common.data.runtime.metadata.SMetadata.Condition
- Enclosing class:
SMetadata
To add load conditions to a data/resource pack file, add a "load_condition" object to its metadata
There currently are 5 types of conditions:
- "dependency": Takes an extra mod argument. File will only be loaded if said namespace is running.
- "config": Takes an extra entry argument. File will only be loaded if the corresponding
- "and": Takes a list of conditions in a values field. Yields true only if every sub condition is true.
- "or": Takes a list of conditions in a values field. Yields true if at least one sub condition is true.
For example:
There currently are 5 types of conditions:
- "dependency": Takes an extra mod argument. File will only be loaded if said namespace is running.
- "config": Takes an extra entry argument. File will only be loaded if the corresponding
ConfigEntry evaluates to true.
- "not": Takes another condition in a value field and inverts it. - "and": Takes a list of conditions in a values field. Yields true only if every sub condition is true.
- "or": Takes a list of conditions in a values field. Yields true if at least one sub condition is true.
For example:
{
// rest of your metadata file
"load_condition": {
"type": "and",
"values": [
{
"type": "config",
"entry": "sollib/test:test_category.nested.exists"
},
{
"type": "not",
"value: {
"type": "dependency",
"mod": "fabric"
}
}
]
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanshouldLoad(com.google.gson.JsonObject condition) static booleanshouldLoad(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.PackResources pack, net.minecraft.server.packs.PackType type)
-
Constructor Details
-
Condition
public Condition()
-
-
Method Details
-
shouldLoad
public static boolean shouldLoad(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.PackResources pack, net.minecraft.server.packs.PackType type) -
shouldLoad
public static boolean shouldLoad(com.google.gson.JsonObject condition)
-