Interface ResourceCondition


public interface ResourceCondition
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<ResourceCondition> CODEC
      A codec for a resource condition. It is a map with a condition key denoting the ID of the condition, and any additional values required by the specific condition.
    • LIST_CODEC

      static final com.mojang.serialization.Codec<List<ResourceCondition>> LIST_CODEC
      A codec for a list of conditions.
    • CONDITION_CODEC

      static final com.mojang.serialization.Codec<ResourceCondition> CONDITION_CODEC
      A codec for parsing load conditions. Can either be an array of conditions or a single condition.
  • Method Details

    • getType

      ResourceConditionType<?> getType()
      Returns:
      the type of the condition
    • test

      boolean test(@Nullable RegistryOps.RegistryInfoGetter registryInfo)
      Tests the condition. The passed registry lookup, if any, includes all static and dynamic entries. However, the tags are not loaded yet.
      Parameters:
      registryInfo - the registry lookup, or null in case registry is unavailable
      Returns:
      whether the condition was successful
      Implementation Note:
      registryLookup should never be null for supported use cases (such as recipes or advancements). However, it may be null in client-side resources, or for non-vanilla resource types.