Class CountedIngredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
com.minecolonies.api.crafting.CountedIngredient
All Implemented Interfaces:
Predicate<net.minecraft.world.item.ItemStack>

public class CountedIngredient extends net.minecraft.world.item.crafting.Ingredient
An ingredient that can be used in a vanilla recipe to require more than one item in a particular input slot. { "type": "minecolonies:counted", "item": { "item": "minecraft:cobblestone" // could be a tag or something else }, "count": 16 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient

    net.minecraft.world.item.crafting.Ingredient.ItemValue, net.minecraft.world.item.crafting.Ingredient.TagValue, net.minecraft.world.item.crafting.Ingredient.Value
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     

    Fields inherited from class net.minecraft.world.item.crafting.Ingredient

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    CountedIngredient(@NotNull net.minecraft.world.item.crafting.Ingredient child, int count)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.world.item.crafting.Ingredient
    The underlying ingredient.
    int
    The number of items required.
    @NotNull net.minecraft.world.item.ItemStack[]
     
    @NotNull net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient>
     
    @NotNull com.google.gson.JsonElement
     

    Methods inherited from class net.minecraft.world.item.crafting.Ingredient

    checkInvalidation, fromJson, fromJson, fromNetwork, fromValues, getStackingIds, invalidate, invalidateAll, isEmpty, isSimple, isVanilla, markValid, merge, of, of, of, of, of, test, toNetwork, valueFromJson

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Field Details

    • ID

      public static final net.minecraft.resources.ResourceLocation ID
  • Constructor Details

    • CountedIngredient

      public CountedIngredient(@NotNull @NotNull net.minecraft.world.item.crafting.Ingredient child, int count)
  • Method Details

    • getChild

      @NotNull public @NotNull net.minecraft.world.item.crafting.Ingredient getChild()
      The underlying ingredient.
    • getCount

      public int getCount()
      The number of items required.
    • getItems

      @NotNull public @NotNull net.minecraft.world.item.ItemStack[] getItems()
      Overrides:
      getItems in class net.minecraft.world.item.crafting.Ingredient
    • toJson

      @NotNull public @NotNull com.google.gson.JsonElement toJson()
      Overrides:
      toJson in class net.minecraft.world.item.crafting.Ingredient
    • getSerializer

      @NotNull public @NotNull net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient> getSerializer()
      Overrides:
      getSerializer in class net.minecraft.world.item.crafting.Ingredient