Record Class PacketContext<T>
java.lang.Object
java.lang.Record
commonnetwork.networking.data.PacketContext<T>
-
Constructor Summary
ConstructorsConstructorDescriptionPacketContext(net.minecraft.server.level.ServerPlayer sender, T message, Side side) Creates an instance of aPacketContextrecord class.PacketContext(T message, Side side) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.net.minecraft.server.level.ServerPlayersender()Returns the value of thesenderrecord component.side()Returns the value of thesiderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PacketContext
-
PacketContext
Creates an instance of aPacketContextrecord class.- Parameters:
sender- the value for thesenderrecord componentmessage- the value for themessagerecord componentside- the value for thesiderecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
sender
public net.minecraft.server.level.ServerPlayer sender()Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
side
Returns the value of thesiderecord component.- Returns:
- the value of the
siderecord component
-