Record Class PaperPacketBridge.PacketContext
java.lang.Object
java.lang.Record
dev.shamoo.runtime.platform.paper.packet.PaperPacketBridge.PacketContext
- Enclosing class:
PaperPacketBridge
public static record PaperPacketBridge.PacketContext(PaperPacketBridge.Direction direction, PacketRegistry.Phase phase, PacketRegistry.Direction protocolDirection, int protocolId, PacketHandle packet)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPacketContext(PaperPacketBridge.Direction direction, PacketRegistry.Phase phase, PacketRegistry.Direction protocolDirection, int protocolId, PacketHandle packet) Creates an instance of aPacketContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.packet()Returns the value of thepacketrecord component.phase()Returns the value of thephaserecord component.Returns the value of theprotocolDirectionrecord component.intReturns the value of theprotocolIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PacketContext
public PacketContext(PaperPacketBridge.Direction direction, PacketRegistry.Phase phase, PacketRegistry.Direction protocolDirection, int protocolId, PacketHandle packet) Creates an instance of aPacketContextrecord class.- Parameters:
direction- the value for thedirectionrecord componentphase- the value for thephaserecord componentprotocolDirection- the value for theprotocolDirectionrecord componentprotocolId- the value for theprotocolIdrecord componentpacket- the value for thepacketrecord component
-
-
Method Details
-
registration
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
protocolDirection
Returns the value of theprotocolDirectionrecord component.- Returns:
- the value of the
protocolDirectionrecord component
-
protocolId
public int protocolId()Returns the value of theprotocolIdrecord component.- Returns:
- the value of the
protocolIdrecord component
-
packet
Returns the value of thepacketrecord component.- Returns:
- the value of the
packetrecord component
-