Record Class PacketToClient
java.lang.Object
java.lang.Record
dev.ultreon.mods.xinexlib.dev.network.packets.PacketToClient
- All Implemented Interfaces:
ClientEndpoint,Packet<PacketToClient>,PacketToClient<PacketToClient>
public record PacketToClient(String message)
extends Record
implements PacketToClient<PacketToClient>
-
Constructor Summary
ConstructorsConstructorDescriptionPacketToClient(String message) Creates an instance of aPacketToClientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidfinal inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.static PacketToClientread(net.minecraft.network.RegistryFriendlyByteBuf buf) final StringtoString()Returns a string representation of this record class.voidwrite(net.minecraft.network.RegistryFriendlyByteBuf buf)
-
Constructor Details
-
PacketToClient
Creates an instance of aPacketToClientrecord class.- Parameters:
message- the value for themessagerecord component
-
-
Method Details
-
read
-
write
public void write(net.minecraft.network.RegistryFriendlyByteBuf buf) - Specified by:
writein interfacePacket<PacketToClient>
-
handle
- Specified by:
handlein interfaceClientEndpoint
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-