Record Class RecipeContentPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.RecipeContentPayload
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record RecipeContentPayload(Set<RecipeType<?>> recipeTypes, List<RecipeHolder<?>> recipes)
extends Record
implements CustomPacketPayload
We use this to transfer the actual recipe content from server to client.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
CustomPacketPayload.FallbackProvider<B extends FriendlyByteBuf>, CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends FriendlyByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<RecipeHolder<?>> The field for therecipesrecord component.private final Set<RecipeType<?>> The field for therecipeTypesrecord component.static final StreamCodec<RegistryFriendlyByteBuf, RecipeContentPayload> static final CustomPacketPayload.Type<RecipeContentPayload> -
Constructor Summary
ConstructorsConstructorDescriptionRecipeContentPayload(Set<RecipeType<?>> recipeTypes, List<RecipeHolder<?>> recipes) Creates an instance of aRecipeContentPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RecipeContentPayloadcreate(Collection<RecipeType<?>> recipeTypes, RecipeMap recipes) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.List<RecipeHolder<?>> recipes()Returns the value of therecipesrecord component.Set<RecipeType<?>> Returns the value of therecipeTypesrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
recipeTypes
The field for therecipeTypesrecord component. -
recipes
The field for therecipesrecord component. -
TYPE
-
STREAM_CODEC
-
-
Constructor Details
-
RecipeContentPayload
Creates an instance of aRecipeContentPayloadrecord class.- Parameters:
recipeTypes- the value for therecipeTypesrecord componentrecipes- the value for therecipesrecord component
-
-
Method Details
-
create
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
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). -
recipeTypes
Returns the value of therecipeTypesrecord component.- Returns:
- the value of the
recipeTypesrecord component
-
recipes
Returns the value of therecipesrecord component.- Returns:
- the value of the
recipesrecord component
-