Record Class ServerboundPlaceRecipePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundPlaceRecipePacket(int containerId, RecipeDisplayId recipe, boolean useMaxItems)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thecontainerIdrecord component.private final RecipeDisplayIdThe field for thereciperecord component.static final StreamCodec<FriendlyByteBuf, ServerboundPlaceRecipePacket> private final booleanThe field for theuseMaxItemsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundPlaceRecipePacket(int containerId, RecipeDisplayId recipe, boolean useMaxItems) Creates an instance of aServerboundPlaceRecipePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecontainerIdrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.recipe()Returns the value of thereciperecord component.final StringtoString()Returns a string representation of this record class.type()booleanReturns the value of theuseMaxItemsrecord component.Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
containerId
private final int containerIdThe field for thecontainerIdrecord component. -
recipe
The field for thereciperecord component. -
useMaxItems
private final boolean useMaxItemsThe field for theuseMaxItemsrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundPlaceRecipePacket
Creates an instance of aServerboundPlaceRecipePacketrecord class.- Parameters:
containerId- the value for thecontainerIdrecord componentrecipe- the value for thereciperecord componentuseMaxItems- the value for theuseMaxItemsrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. -
containerId
public int containerId()Returns the value of thecontainerIdrecord component.- Returns:
- the value of the
containerIdrecord component
-
recipe
Returns the value of thereciperecord component.- Returns:
- the value of the
reciperecord component
-
useMaxItems
public boolean useMaxItems()Returns the value of theuseMaxItemsrecord component.- Returns:
- the value of the
useMaxItemsrecord component
-