Class IngredientComponentCategoryType<T,M,C>

java.lang.Object
org.cyclops.commoncapabilities.api.ingredient.IngredientComponentCategoryType<T,M,C>
Type Parameters:
T - An instance type.
M - A match condition type.
C - A classifier type.

public class IngredientComponentCategoryType<T,M,C> extends Object
A categorizer for an instance type.
  • Constructor Details

    • IngredientComponentCategoryType

      public IngredientComponentCategoryType(net.minecraft.resources.ResourceLocation name, Class<C> categoryType, boolean referenceEqual, Function<T,C> classifier, M matchCondition, boolean primaryQuantifier)
  • Method Details

    • getName

      public net.minecraft.resources.ResourceLocation getName()
      Returns:
      The name of this category.
    • getCategoryType

      public Class<C> getCategoryType()
      Returns:
      The category class.
    • isReferenceEqual

      public boolean isReferenceEqual()
      Returns:
      If elements of the given category type can be compared using reference-equality. This should be set to true where possible, as it will lead to better performance.
    • getClassifier

      public Function<T,C> getClassifier()
      Returns:
      A classifier function that will map an instance to a category of the given type.
    • getMatchCondition

      public M getMatchCondition()
      Returns:
      The match condition that identifies exactly this this category type.
    • isPrimaryQuantifier

      public boolean isPrimaryQuantifier()
      Returns:
      If this categorizer is indicative of instance quantities.
    • toString

      public String toString()
      Overrides:
      toString in class Object