Interface ICondition

All Known Implementing Classes:
AndCondition, FalseCondition, ItemExistsCondition, ModLoadedCondition, NotCondition, OrCondition, TagEmptyCondition, TrueCondition

public interface ICondition
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<ICondition> CODEC
    • LIST_CODEC

      static final com.mojang.serialization.Codec<List<ICondition>> 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

      static <V, T> Optional<T> getWithConditionalCodec(com.mojang.serialization.Codec<Optional<T>> codec, com.mojang.serialization.DynamicOps<V> ops, V element)
    • 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

      boolean test(ICondition.IContext context)
    • codec

      com.mojang.serialization.MapCodec<? extends ICondition> codec()