Interface ICondition
- All Known Implementing Classes:
AndCondition
,FalseCondition
,ItemExistsCondition
,ModLoadedCondition
,NotCondition
,OrCondition
,TagEmptyCondition
,TrueCondition
public interface ICondition
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ICondition> static final com.mojang.serialization.Codec
<List<ICondition>> -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<? extends ICondition> codec()
static <V> boolean
conditionsMatched
(com.mojang.serialization.DynamicOps<V> ops, V element) static <V,
T> Optional <T> getConditionally
(com.mojang.serialization.Codec<T> codec, com.mojang.serialization.DynamicOps<V> ops, V element) static <V,
T> Optional <T> getWithConditionalCodec
(com.mojang.serialization.Codec<Optional<T>> codec, com.mojang.serialization.DynamicOps<V> ops, V element) static <V,
T> Optional <T> getWithWithConditionsCodec
(com.mojang.serialization.Codec<Optional<WithConditions<T>>> codec, com.mojang.serialization.DynamicOps<V> ops, V elements) boolean
test
(ICondition.IContext context) static void
writeConditions
(com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> jsonOps, com.google.gson.JsonObject jsonObject, List<ICondition> conditions) Writes a list of conditions to a JSON object.static void
writeConditions
(HolderLookup.Provider registries, com.google.gson.JsonObject jsonObject, List<ICondition> conditions) Writes a list of conditions to a JSON object.static void
writeConditions
(HolderLookup.Provider registries, com.google.gson.JsonObject jsonObject, ICondition... conditions) Writes an array of conditions to a JSON object.
-
Field Details
-
CODEC
-
LIST_CODEC
-
-
Method Details
-
getConditionally
static <V,T> Optional<T> getConditionally(com.mojang.serialization.Codec<T> codec, com.mojang.serialization.DynamicOps<V> ops, V element) -
getWithConditionalCodec
-
getWithWithConditionsCodec
static <V,T> Optional<T> getWithWithConditionsCodec(com.mojang.serialization.Codec<Optional<WithConditions<T>>> codec, com.mojang.serialization.DynamicOps<V> ops, V elements) -
conditionsMatched
static <V> boolean conditionsMatched(com.mojang.serialization.DynamicOps<V> ops, V element) -
writeConditions
static void writeConditions(HolderLookup.Provider registries, com.google.gson.JsonObject jsonObject, ICondition... conditions) Writes an array of conditions to a JSON object. -
writeConditions
static void writeConditions(HolderLookup.Provider registries, com.google.gson.JsonObject jsonObject, List<ICondition> conditions) Writes a list of conditions to a JSON object. -
writeConditions
static void writeConditions(com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> jsonOps, com.google.gson.JsonObject jsonObject, List<ICondition> conditions) Writes a list of conditions to a JSON object. -
test
-
codec
com.mojang.serialization.MapCodec<? extends ICondition> codec()
-