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
Modifier 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
Modifier and TypeFieldDescriptionprivate BundlerInfo
private final List
<ProtocolInfoBuilder.CodecEntry<T, ?, B>> private final PacketFlow
private final ConnectionProtocol
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<P extends Packet<? super T>>
ProtocolInfoBuilder<T, B> addPacket
(PacketType<P> p_335373_, StreamCodec<? super B, P> p_333531_) private StreamCodec
<io.netty.buffer.ByteBuf, Packet<? super T>> buildPacketCodec
(Function<io.netty.buffer.ByteBuf, B> p_331741_, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> p_329135_) static <T extends ClientboundPacketListener>
ProtocolInfo<T> clientboundProtocol
(ConnectionProtocol p_329688_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_332900_) static <T extends ClientboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> clientboundProtocolUnbound
(ConnectionProtocol p_330385_, Consumer<ProtocolInfoBuilder<T, B>> p_330670_) private static <L extends PacketListener>
ProtocolInfo<L> protocol
(ConnectionProtocol p_334123_, PacketFlow p_327838_, Consumer<ProtocolInfoBuilder<L, FriendlyByteBuf>> p_327993_) private static <L extends PacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<L, B> protocolUnbound
(ConnectionProtocol p_330235_, PacketFlow p_335045_, Consumer<ProtocolInfoBuilder<L, B>> p_329753_) static <T extends ServerboundPacketListener>
ProtocolInfo<T> serverboundProtocol
(ConnectionProtocol p_331618_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_330318_) static <T extends ServerboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> serverboundProtocolUnbound
(ConnectionProtocol p_330435_, Consumer<ProtocolInfoBuilder<T, B>> p_333183_) <P extends BundlePacket<? super T>,
D extends BundleDelimiterPacket<? super T>>
ProtocolInfoBuilder<T, B> withBundlePacket
(PacketType<P> p_336277_, Function<Iterable<Packet<? super T>>, P> p_331716_, D p_328432_)
-
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> p_335373_, StreamCodec<? super B, P> p_333531_) -
withBundlePacket
public <P extends BundlePacket<? super T>,D extends BundleDelimiterPacket<? super T>> ProtocolInfoBuilder<T,B> withBundlePacket(PacketType<P> p_336277_, Function<Iterable<Packet<? super T>>, P> p_331716_, D p_328432_) -
buildPacketCodec
private StreamCodec<io.netty.buffer.ByteBuf,Packet<? super T>> buildPacketCodec(Function<io.netty.buffer.ByteBuf, B> p_331741_, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> p_329135_) -
build
-
buildUnbound
-
protocol
private static <L extends PacketListener> ProtocolInfo<L> protocol(ConnectionProtocol p_334123_, PacketFlow p_327838_, Consumer<ProtocolInfoBuilder<L, FriendlyByteBuf>> p_327993_) -
serverboundProtocol
public static <T extends ServerboundPacketListener> ProtocolInfo<T> serverboundProtocol(ConnectionProtocol p_331618_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_330318_) -
clientboundProtocol
public static <T extends ClientboundPacketListener> ProtocolInfo<T> clientboundProtocol(ConnectionProtocol p_329688_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_332900_) -
protocolUnbound
private static <L extends PacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<L,B> protocolUnbound(ConnectionProtocol p_330235_, PacketFlow p_335045_, Consumer<ProtocolInfoBuilder<L, B>> p_329753_) -
serverboundProtocolUnbound
public static <T extends ServerboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> serverboundProtocolUnbound(ConnectionProtocol p_330435_, Consumer<ProtocolInfoBuilder<T, B>> p_333183_) -
clientboundProtocolUnbound
public static <T extends ClientboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> clientboundProtocolUnbound(ConnectionProtocol p_330385_, Consumer<ProtocolInfoBuilder<T, B>> p_330670_)
-