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_320673_, StreamCodec<? super B, P> p_319828_) private StreamCodec
<io.netty.buffer.ByteBuf, Packet<? super T>> buildPacketCodec
(Function<io.netty.buffer.ByteBuf, B> p_320922_, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> p_320733_) static <T extends ClientboundPacketListener>
ProtocolInfo<T> clientboundProtocol
(ConnectionProtocol p_320428_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_320292_) static <T extends ClientboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> clientboundProtocolUnbound
(ConnectionProtocol p_320864_, Consumer<ProtocolInfoBuilder<T, B>> p_320056_) private static <L extends PacketListener>
ProtocolInfo<L> protocol
(ConnectionProtocol p_319927_, PacketFlow p_320658_, Consumer<ProtocolInfoBuilder<L, FriendlyByteBuf>> p_320484_) private static <L extends PacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<L, B> protocolUnbound
(ConnectionProtocol p_320849_, PacketFlow p_320146_, Consumer<ProtocolInfoBuilder<L, B>> p_320140_) static <T extends ServerboundPacketListener>
ProtocolInfo<T> serverboundProtocol
(ConnectionProtocol p_319767_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_320799_) static <T extends ServerboundPacketListener,
B extends io.netty.buffer.ByteBuf>
ProtocolInfo.Unbound<T, B> serverboundProtocolUnbound
(ConnectionProtocol p_320741_, Consumer<ProtocolInfoBuilder<T, B>> p_320299_) <P extends BundlePacket<? super T>,
D extends BundleDelimiterPacket<? super T>>
ProtocolInfoBuilder<T, B> withBundlePacket
(PacketType<P> p_320954_, Function<Iterable<Packet<? super T>>, P> p_320241_, D p_320202_)
-
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_320673_, StreamCodec<? super B, P> p_319828_) -
withBundlePacket
public <P extends BundlePacket<? super T>,D extends BundleDelimiterPacket<? super T>> ProtocolInfoBuilder<T,B> withBundlePacket(PacketType<P> p_320954_, Function<Iterable<Packet<? super T>>, P> p_320241_, D p_320202_) -
buildPacketCodec
private StreamCodec<io.netty.buffer.ByteBuf,Packet<? super T>> buildPacketCodec(Function<io.netty.buffer.ByteBuf, B> p_320922_, List<ProtocolInfoBuilder.CodecEntry<T, ?, B>> p_320733_) -
build
-
buildUnbound
-
protocol
private static <L extends PacketListener> ProtocolInfo<L> protocol(ConnectionProtocol p_319927_, PacketFlow p_320658_, Consumer<ProtocolInfoBuilder<L, FriendlyByteBuf>> p_320484_) -
serverboundProtocol
public static <T extends ServerboundPacketListener> ProtocolInfo<T> serverboundProtocol(ConnectionProtocol p_319767_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_320799_) -
clientboundProtocol
public static <T extends ClientboundPacketListener> ProtocolInfo<T> clientboundProtocol(ConnectionProtocol p_320428_, Consumer<ProtocolInfoBuilder<T, FriendlyByteBuf>> p_320292_) -
protocolUnbound
private static <L extends PacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<L,B> protocolUnbound(ConnectionProtocol p_320849_, PacketFlow p_320146_, Consumer<ProtocolInfoBuilder<L, B>> p_320140_) -
serverboundProtocolUnbound
public static <T extends ServerboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> serverboundProtocolUnbound(ConnectionProtocol p_320741_, Consumer<ProtocolInfoBuilder<T, B>> p_320299_) -
clientboundProtocolUnbound
public static <T extends ClientboundPacketListener,B extends io.netty.buffer.ByteBuf> ProtocolInfo.Unbound<T,B> clientboundProtocolUnbound(ConnectionProtocol p_320864_, Consumer<ProtocolInfoBuilder<T, B>> p_320056_)
-