Record Class RecipeDisplayEntry
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.display.RecipeDisplayEntry
public record RecipeDisplayEntry(RecipeDisplayId id, RecipeDisplay display, OptionalInt group, RecipeBookCategory category, Optional<List<Ingredient>> craftingRequirements)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RecipeBookCategoryThe field for thecategoryrecord component.private final Optional<List<Ingredient>> The field for thecraftingRequirementsrecord component.private final RecipeDisplayThe field for thedisplayrecord component.private final OptionalIntThe field for thegrouprecord component.private final RecipeDisplayIdThe field for theidrecord component.static final StreamCodec<RegistryFriendlyByteBuf, RecipeDisplayEntry> -
Constructor Summary
ConstructorsConstructorDescriptionRecipeDisplayEntry(RecipeDisplayId id, RecipeDisplay display, OptionalInt group, RecipeBookCategory category, Optional<List<Ingredient>> craftingRequirements) Creates an instance of aRecipeDisplayEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCraft(StackedItemContents pStackedItemContents) category()Returns the value of thecategoryrecord component.Returns the value of thecraftingRequirementsrecord component.display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.resultItems(ContextMap pContext) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
id
The field for theidrecord component. -
display
The field for thedisplayrecord component. -
group
The field for thegrouprecord component. -
category
The field for thecategoryrecord component. -
craftingRequirements
The field for thecraftingRequirementsrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
RecipeDisplayEntry
public RecipeDisplayEntry(RecipeDisplayId id, RecipeDisplay display, OptionalInt group, RecipeBookCategory category, Optional<List<Ingredient>> craftingRequirements) Creates an instance of aRecipeDisplayEntryrecord class.- Parameters:
id- the value for theidrecord componentdisplay- the value for thedisplayrecord componentgroup- the value for thegrouprecord componentcategory- the value for thecategoryrecord componentcraftingRequirements- the value for thecraftingRequirementsrecord component
-
-
Method Details
-
resultItems
-
canCraft
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
craftingRequirements
Returns the value of thecraftingRequirementsrecord component.- Returns:
- the value of the
craftingRequirementsrecord component
-