Package com.minecolonies.core.recipes
Class FoodIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
com.minecolonies.core.recipes.FoodIngredient
- All Implemented Interfaces:
Predicate<net.minecraft.world.item.ItemStack>
public class FoodIngredient
extends net.minecraft.world.item.crafting.Ingredient
An ingredient that can be used in a vanilla recipe to match food items.
Only items with at least *some* healing and saturation are counted, and
further restrictions can be imposed if desired.
// any food item at all
{
"type": "minecolonies:food"
}
// any food with at least 4 healing points (inclusive)
{
"type": "minecolonies:food",
"min-healing": 4
}
// any food with less than 1.0 saturation points (not including 1.0 itself)
{
"type": "minecolonies:food",
"max-saturation": 1.0
}
Conditions can also be combined.
Min bounds are inclusive and max bounds are exclusive.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested 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
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY -
Method Summary
Modifier and TypeMethodDescription@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, getItems, 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 -
MIN_HEALING_PROP
- See Also:
-
MAX_HEALING_PROP
- See Also:
-
MIN_SATURATION_PROP
- See Also:
-
MAX_SATURATION_PROP
- See Also:
-
-
Method Details
-
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
-