Package net.minecraft.network.protocol
Class ProtocolInfoBuilder<T extends PacketListener,B extends io.netty.buffer.ByteBuf>
java.lang.Object
net.minecraft.network.protocol.ProtocolInfoBuilder<T,B>
public class ProtocolInfoBuilder<T extends PacketListener,B extends io.netty.buffer.ByteBuf>
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
ProtocolInfoBuilder.CodecEntry<T extends PacketListener,
P extends Packet<? super T>, B extends io.netty.buffer.ByteBuf> (package private) static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BundlerInfo
private final List
<ProtocolInfoBuilder.CodecEntry<T, ?, B>> (package private) final PacketFlow
(package private) final ConnectionProtocol
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P extends Packet<? super T>>
ProtocolInfoBuilder<T, B> addPacket
(PacketType<P> pType, StreamCodec<? super B, P> pSerializer) (package private) StreamCodec
<io.netty.buffer.ByteBuf, Packet<? super T>> buildPacketCodec
(Function<io.netty.buffer.ByteBuf, B> pBufferFactory, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> pCodecs) static <T extends ClientboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> clientboundProtocol
(ConnectionProtocol pProtocol, Consumer<ProtocolInfoBuilder<T, B>> pSetup) private static <L extends PacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<L, B> protocol
(ConnectionProtocol pProtocol, PacketFlow pFlow, Consumer<ProtocolInfoBuilder<L, B>> pSetup) static <T extends ServerboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> serverboundProtocol
(ConnectionProtocol pProtocol, Consumer<ProtocolInfoBuilder<T, B>> pSetup) <P extends BundlePacket<? super T>,
D extends BundleDelimiterPacket<? super T>>
ProtocolInfoBuilder<T, B> withBundlePacket
(PacketType<P> pType, Function<Iterable<Packet<? super T>>, P> pBundler, D pPacket)
-
Field Details
-
protocol
-
flow
-
codecs
private final List<ProtocolInfoBuilder.CodecEntry<T extends PacketListener,?, codecsB extends io.netty.buffer.ByteBuf>> -
bundlerInfo
-
-
Constructor Details
-
ProtocolInfoBuilder
-
-
Method Details
-
addPacket
public <P extends Packet<? super T>> ProtocolInfoBuilder<T,B> addPacket(PacketType<P> pType, StreamCodec<? super B, P> pSerializer) -
withBundlePacket
public <P extends BundlePacket<? super T>,D extends BundleDelimiterPacket<? super T>> ProtocolInfoBuilder<T,B> withBundlePacket(PacketType<P> pType, Function<Iterable<Packet<? super T>>, P> pBundler, D pPacket) -
buildPacketCodec
StreamCodec<io.netty.buffer.ByteBuf,Packet<? super T>> buildPacketCodec(Function<io.netty.buffer.ByteBuf, B> pBufferFactory, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> pCodecs) -
build
-
buildUnbound
-
protocol
private static <L extends PacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<L,B> protocol(ConnectionProtocol pProtocol, PacketFlow pFlow, Consumer<ProtocolInfoBuilder<L, B>> pSetup) -
serverboundProtocol
public static <T extends ServerboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> serverboundProtocol(ConnectionProtocol pProtocol, Consumer<ProtocolInfoBuilder<T, B>> pSetup) -
clientboundProtocol
public static <T extends ClientboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> clientboundProtocol(ConnectionProtocol pProtocol, Consumer<ProtocolInfoBuilder<T, B>> pSetup)
-