Record Class RecipeCache.Entry
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.RecipeCache.Entry
- Enclosing class:
RecipeCache
static record RecipeCache.Entry(NonNullList<ItemStack> key, int width, int height, @Nullable RecipeHolder<CraftingRecipe> value)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theheightrecord component.private final NonNullList<ItemStack> The field for thekeyrecord component.private final RecipeHolder<CraftingRecipe> The field for thevaluerecord component.private final intThe field for thewidthrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntry(NonNullList<ItemStack> key, int width, int height, RecipeHolder<CraftingRecipe> value) Creates an instance of aEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.key()Returns the value of thekeyrecord component.booleanmatches(CraftingInput p_344906_) final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
key
The field for thekeyrecord component. -
width
private final int widthThe field for thewidthrecord component. -
height
private final int heightThe field for theheightrecord component. -
value
The field for thevaluerecord component.
-
-
Constructor Details
-
Entry
Entry(NonNullList<ItemStack> key, int width, int height, @Nullable RecipeHolder<CraftingRecipe> value) Creates an instance of aEntryrecord class.- Parameters:
key- the value for thekeyrecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
matches
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-