Record Class PassthroughPacket
java.lang.Object
java.lang.Record
net.fabricmc.fabric.impl.networking.splitter.PassthroughPacket
- All Implemented Interfaces:
net.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>
public record PassthroughPacket(io.netty.buffer.ByteBuf buf)
extends Record
implements net.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>
A fake packet implementation used to pass already encoded data from
FabricPacketSplitter to PacketEncoder.
Allows to avoid requiring to serialize the packet twice.-
Constructor Summary
ConstructorsConstructorDescriptionPassthroughPacket(io.netty.buffer.ByteBuf buf) Creates an instance of aPassthroughPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufbuf()Returns the value of thebufrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(net.minecraft.network.PacketListener listener) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.PacketType<? extends net.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>> type()Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Constructor Details
-
PassthroughPacket
public PassthroughPacket(io.netty.buffer.ByteBuf buf) Creates an instance of aPassthroughPacketrecord class.- Parameters:
buf- the value for thebufrecord component
-
-
Method Details
-
type
public net.minecraft.network.protocol.PacketType<? extends net.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>> type()- Specified by:
typein interfacenet.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>
-
handle
public void handle(net.minecraft.network.PacketListener listener) - Specified by:
handlein interfacenet.minecraft.network.protocol.Packet<net.minecraft.network.PacketListener>
-
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). -
buf
public io.netty.buffer.ByteBuf buf()Returns the value of thebufrecord component.- Returns:
- the value of the
bufrecord component
-