Record Class CraftingRecipe.CraftingBookInfo
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.CraftingRecipe.CraftingBookInfo
- All Implemented Interfaces:
Recipe.BookInfo<CraftingBookCategory>
- Enclosing interface:
CraftingRecipe
public static record CraftingRecipe.CraftingBookInfo(CraftingBookCategory category, String group)
extends Record
implements Recipe.BookInfo<CraftingBookCategory>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Recipe.BookInfo
Recipe.BookInfo.Constructor<CategoryType, SelfType> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CraftingBookCategoryThe field for thecategoryrecord component.private final StringThe field for thegrouprecord component.static final com.mojang.serialization.MapCodec<CraftingRecipe.CraftingBookInfo> static final StreamCodec<RegistryFriendlyByteBuf, CraftingRecipe.CraftingBookInfo> -
Constructor Summary
ConstructorsConstructorDescriptionCraftingBookInfo(CraftingBookCategory category, String group) Creates an instance of aCraftingBookInforecord 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
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, CraftingRecipe.CraftingBookInfo> STREAM_CODEC
-
-
Constructor Details
-
CraftingBookInfo
Creates an instance of aCraftingBookInforecord 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<CraftingBookCategory>- Returns:
- the value of the
categoryrecord component
-
group
Returns the value of thegrouprecord component.- Specified by:
groupin interfaceRecipe.BookInfo<CraftingBookCategory>- Returns:
- the value of the
grouprecord component
-