Record Class FoodFacts
java.lang.Object
java.lang.Record
ke.ric.api.food.FoodFacts
- Record Components:
itemId- normalized uppercase item identifieringredientIds- uppercase ingredient identifierscategories- uppercase inferred dietary categories- uppercase custom item tagsdietaryFacts- map of dietary flags toFoodFacts.Truthcomplete-truewhen lineage classification is complete
public record FoodFacts(String itemId, Set<String> ingredientIds, Set<String> categories, Set<String> tags, Map<String, FoodFacts.Truth> dietaryFacts, boolean complete)
extends Record
Legacy V1 immutable description of what is known about one food stack.
Prefer
FoodFactsV2 and HeirloomAPI.foodFactsV2(org.bukkit.inventory.ItemStack)
for new integrations.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecategoriesrecord component.booleancomplete()Returns the value of thecompleterecord component.Returns the value of thedietaryFactsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theingredientIdsrecord component.itemId()Returns the value of theitemIdrecord component.static FoodFactsMerge every consumed ingredient, including nested provenance and the result's own metadata.static FoodFactsproduced(FoodFacts result, Collection<FoodFacts> inputs) static FoodFactsread(org.bukkit.inventory.ItemStack item) Read current facts or conservatively interpret older Heirloom metadata.static FoodFactsA directly identified, pure ingredient.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.static FoodFactsLegacy or external item: positive clues remain usable; absence is unproved.static FoodFactsvanilla(org.bukkit.Material material) Known fixed vanilla recipes expose their real inputs; other mixed foods remain unknown.static voidPersist normalized facts on the actual output without touching amount or other metadata.
-
Constructor Details
-
FoodFacts
public FoodFacts(String itemId, Set<String> ingredientIds, Set<String> categories, Set<String> tags, Map<String, FoodFacts.Truth> dietaryFacts, boolean complete) Creates an instance of aFoodFactsrecord class.- Parameters:
itemId- the value for theitemIdrecord componentingredientIds- the value for theingredientIdsrecord componentcategories- the value for thecategoriesrecord componenttags- the value for thetagsrecord componentdietaryFacts- the value for thedietaryFactsrecord componentcomplete- the value for thecompleterecord component
-
-
Method Details
-
single
-
vanilla
Known fixed vanilla recipes expose their real inputs; other mixed foods remain unknown. -
unknown
-
produced
-
produced
-
read
Read current facts or conservatively interpret older Heirloom metadata. -
write
Persist normalized facts on the actual output without touching amount or other metadata. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
itemId
-
ingredientIds
Returns the value of theingredientIdsrecord component.- Returns:
- the value of the
ingredientIdsrecord component
-
categories
Returns the value of thecategoriesrecord component.- Returns:
- the value of the
categoriesrecord component
-
tags
-
dietaryFacts
Returns the value of thedietaryFactsrecord component.- Returns:
- the value of the
dietaryFactsrecord component
-
complete
-