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 Classes
    Modifier and Type
    Class
    Description
    static class 
     
    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
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

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

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    @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, getItems, 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

  • Method Details

    • 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