Record Class AbstractCookingRecipe.CookingBookInfo
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.AbstractCookingRecipe.CookingBookInfo
- All Implemented Interfaces:
Recipe.BookInfo<CookingBookCategory>
- Enclosing class:
AbstractCookingRecipe
public static record AbstractCookingRecipe.CookingBookInfo(CookingBookCategory category, String group)
extends Record
implements Recipe.BookInfo<CookingBookCategory>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Recipe.BookInfo
Recipe.BookInfo.Constructor<CategoryType, SelfType> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CookingBookCategoryThe field for thecategoryrecord component.private final StringThe field for thegrouprecord component.static final com.mojang.serialization.MapCodec<AbstractCookingRecipe.CookingBookInfo> -
Constructor Summary
ConstructorsConstructorDescriptionCookingBookInfo(CookingBookCategory category, String group) Creates an instance of aCookingBookInforecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord 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.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
category
The field for thecategoryrecord component. -
group
The field for thegrouprecord component. -
MAP_CODEC
public static final com.mojang.serialization.MapCodec<AbstractCookingRecipe.CookingBookInfo> MAP_CODEC -
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, AbstractCookingRecipe.CookingBookInfo> STREAM_CODEC
-
-
Constructor Details
-
CookingBookInfo
Creates an instance of aCookingBookInforecord class.- Parameters:
category- the value for thecategoryrecord componentgroup- the value for thegrouprecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
category
Returns the value of thecategoryrecord component.- Specified by:
categoryin interfaceRecipe.BookInfo<CookingBookCategory>- Returns:
- the value of the
categoryrecord component
-
group
Returns the value of thegrouprecord component.- Specified by:
groupin interfaceRecipe.BookInfo<CookingBookCategory>- Returns:
- the value of the
grouprecord component
-