Record Class PacketRecordableAction

java.lang.Object
java.lang.Record
com.petrolpark.core.actionrecord.packet.PacketRecordableAction
All Implemented Interfaces:
IRecordableAction<PacketRecordableAction>

public record PacketRecordableAction(net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ServerGamePacketListener> packet) extends Record implements IRecordableAction<PacketRecordableAction>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<PacketRecordableAction>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PacketRecordableAction(net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ServerGamePacketListener> packet)
    Creates an instance of a PacketRecordableAction record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.Codec<PacketRecordableAction>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ServerGamePacketListener>
    Returns the value of the packet record component.
    void
    play(net.minecraft.server.level.ServerPlayer player)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • PacketRecordableAction

      public PacketRecordableAction(net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ServerGamePacketListener> packet)
      Creates an instance of a PacketRecordableAction record class.
      Parameters:
      packet - the value for the packet record component
  • Method Details

    • play

      public void play(net.minecraft.server.level.ServerPlayer player)
      Specified by:
      play in interface IRecordableAction<PacketRecordableAction>
    • codec

      public com.mojang.serialization.Codec<PacketRecordableAction> codec()
      Specified by:
      codec in interface IRecordableAction<PacketRecordableAction>
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • packet

      public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ServerGamePacketListener> packet()
      Returns the value of the packet record component.
      Returns:
      the value of the packet record component