Record Class RecipeCache.Entry
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.RecipeCache.Entry
- Enclosing class:
RecipeCache
private 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 @Nullable RecipeHolder<CraftingRecipe> The field for thevaluerecord component.private final intThe field for thewidthrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEntry(NonNullList<ItemStack> key, int width, int height, @Nullable 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 input) final StringtoString()Returns a string representation of this record class.@Nullable RecipeHolder<CraftingRecipe> 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
private 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
-
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. -
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
-