Package com.minecolonies.api.crafting
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 ClassesNested 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
FieldsFields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionCountedIngredient(@NotNull net.minecraft.world.item.crafting.Ingredient child, int count) -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minecraft.world.item.crafting.IngredientgetChild()The underlying ingredient.intgetCount()The number of items required.@NotNull net.minecraft.world.item.ItemStack[]getItems()@NotNull net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient>@NotNull com.google.gson.JsonElementtoJson()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
-
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:
getItemsin classnet.minecraft.world.item.crafting.Ingredient
-
toJson
@NotNull public @NotNull com.google.gson.JsonElement toJson()- Overrides:
toJsonin classnet.minecraft.world.item.crafting.Ingredient
-
getSerializer
@NotNull public @NotNull net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient> getSerializer()- Overrides:
getSerializerin classnet.minecraft.world.item.crafting.Ingredient
-