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 Details

    • containerId

      private final int containerId
      The field for the containerId record component.
    • recipe

      private final RecipeDisplayId recipe
      The field for the recipe record component.
    • useMaxItems

      private final boolean useMaxItems
      The field for the useMaxItems record component.
    • STREAM_CODEC

      public static final StreamCodec<FriendlyByteBuf,ServerboundPlaceRecipePacket> STREAM_CODEC
  • Constructor Details

    • ServerboundPlaceRecipePacket

      public ServerboundPlaceRecipePacket(int containerId, RecipeDisplayId recipe, boolean useMaxItems)
      Creates an instance of a ServerboundPlaceRecipePacket record class.
      Parameters:
      containerId - the value for the containerId record component
      recipe - the value for the recipe record component
      useMaxItems - the value for the useMaxItems record component
  • Method Details

    • type

      Specified by:
      type in interface Packet<ServerGamePacketListener>
    • handle

      public void handle(ServerGamePacketListener p_134248_)
      Specified by:
      handle in interface Packet<ServerGamePacketListener>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • containerId

      public int containerId()
      Returns the value of the containerId record component.
      Returns:
      the value of the containerId record component
    • recipe

      public RecipeDisplayId recipe()
      Returns the value of the recipe record component.
      Returns:
      the value of the recipe record component
    • useMaxItems

      public boolean useMaxItems()
      Returns the value of the useMaxItems record component.
      Returns:
      the value of the useMaxItems record component