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 RecipeBookCategory
The field for thecategory
record component.private final Optional
<List<Ingredient>> The field for thecraftingRequirements
record component.private final RecipeDisplay
The field for thedisplay
record component.private final OptionalInt
The field for thegroup
record component.private final RecipeDisplayId
The field for theid
record 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 aRecipeDisplayEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCraft
(StackedItemContents p_379995_) category()
Returns the value of thecategory
record component.Returns the value of thecraftingRequirements
record component.display()
Returns the value of thedisplay
record component.final boolean
Indicates whether some other object is "equal to" this one.group()
Returns the value of thegroup
record component.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.resultItems
(ContextMap p_381045_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
id
The field for theid
record component. -
display
The field for thedisplay
record component. -
group
The field for thegroup
record component. -
category
The field for thecategory
record component. -
craftingRequirements
The field for thecraftingRequirements
record component. -
STREAM_CODEC
-
-
Constructor Details
-
RecipeDisplayEntry
public RecipeDisplayEntry(RecipeDisplayId id, RecipeDisplay display, OptionalInt group, RecipeBookCategory category, Optional<List<Ingredient>> craftingRequirements) Creates an instance of aRecipeDisplayEntry
record class.- Parameters:
id
- the value for theid
record componentdisplay
- the value for thedisplay
record componentgroup
- the value for thegroup
record componentcategory
- the value for thecategory
record componentcraftingRequirements
- the value for thecraftingRequirements
record 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 theid
record component.- Returns:
- the value of the
id
record component
-
display
Returns the value of thedisplay
record component.- Returns:
- the value of the
display
record component
-
group
Returns the value of thegroup
record component.- Returns:
- the value of the
group
record component
-
category
Returns the value of thecategory
record component.- Returns:
- the value of the
category
record component
-
craftingRequirements
Returns the value of thecraftingRequirements
record component.- Returns:
- the value of the
craftingRequirements
record component
-