Class ProtocolInfoBuilder<T extends PacketListener, B extends io.netty.buffer.ByteBuf, C>
java.lang.Object
net.minecraft.network.protocol.ProtocolInfoBuilder<T,B,C>
public class ProtocolInfoBuilder<T extends PacketListener, B extends io.netty.buffer.ByteBuf, C>
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordProtocolInfoBuilder.CodecEntry<T extends PacketListener, P extends Packet<? super T>, B extends io.netty.buffer.ByteBuf, C>private static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable BundlerInfoprivate final List<ProtocolInfoBuilder.CodecEntry<T, ?, B, C>> private final PacketFlowprivate final ConnectionProtocol -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPacket(PacketType<P> type, StreamCodec<? super B, P> serializer) addPacket(PacketType<P> type, StreamCodec<? super B, P> serializer, CodecModifier<B, P, C> modifier) private static ProtocolInfo.DetailsbuildDetails(ConnectionProtocol protocol, PacketFlow flow, List<? extends ProtocolInfoBuilder.CodecEntry<?, ?, ?, ?>> codecs) private StreamCodec<io.netty.buffer.ByteBuf, Packet<? super T>> buildPacketCodec(Function<io.netty.buffer.ByteBuf, B> contextWrapper, List<ProtocolInfoBuilder.CodecEntry<T, ?, B, C>> codecs, C context) buildUnbound(C context) static <T extends ClientboundPacketListener, B extends io.netty.buffer.ByteBuf>
SimpleUnboundProtocol<T, B> clientboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, Unit>> config) static <T extends ClientboundPacketListener, B extends io.netty.buffer.ByteBuf, C>
UnboundProtocol<T, B, C> contextClientboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, C>> config) private static <L extends PacketListener, B extends io.netty.buffer.ByteBuf, C>
UnboundProtocol<L, B, C> contextProtocol(ConnectionProtocol id, PacketFlow flow, Consumer<ProtocolInfoBuilder<L, B, C>> config) static <T extends ServerboundPacketListener, B extends io.netty.buffer.ByteBuf, C>
UnboundProtocol<T, B, C> contextServerboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, C>> config) private static <L extends PacketListener, B extends io.netty.buffer.ByteBuf>
SimpleUnboundProtocol<L, B> protocol(ConnectionProtocol id, PacketFlow flow, Consumer<ProtocolInfoBuilder<L, B, Unit>> config) static <T extends ServerboundPacketListener, B extends io.netty.buffer.ByteBuf>
SimpleUnboundProtocol<T, B> serverboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, Unit>> config) <P extends BundlePacket<? super T>, D extends BundleDelimiterPacket<? super T>>
ProtocolInfoBuilder<T, B, C> withBundlePacket(PacketType<P> bundlerPacket, Function<Iterable<Packet<? super T>>, P> constructor, D delimiterPacket)
-
Field Details
-
protocol
-
flow
-
codecs
private final List<ProtocolInfoBuilder.CodecEntry<T extends PacketListener, ?, B extends io.netty.buffer.ByteBuf, C>> codecs -
bundlerInfo
-
-
Constructor Details
-
ProtocolInfoBuilder
-
-
Method Details
-
addPacket
public <P extends Packet<? super T>> ProtocolInfoBuilder<T,B, addPacketC> (PacketType<P> type, StreamCodec<? super B, P> serializer) -
addPacket
public <P extends Packet<? super T>> ProtocolInfoBuilder<T,B, addPacketC> (PacketType<P> type, StreamCodec<? super B, P> serializer, CodecModifier<B, P, C> modifier) -
withBundlePacket
public <P extends BundlePacket<? super T>, D extends BundleDelimiterPacket<? super T>> ProtocolInfoBuilder<T,B, withBundlePacketC> (PacketType<P> bundlerPacket, Function<Iterable<Packet<? super T>>, P> constructor, D delimiterPacket) -
buildPacketCodec
-
buildDetails
private static ProtocolInfo.Details buildDetails(ConnectionProtocol protocol, PacketFlow flow, List<? extends ProtocolInfoBuilder.CodecEntry<?, ?, ?, ?>> codecs) -
buildUnbound
-
buildUnbound
-
protocol
private static <L extends PacketListener, B extends io.netty.buffer.ByteBuf> SimpleUnboundProtocol<L,B> protocol(ConnectionProtocol id, PacketFlow flow, Consumer<ProtocolInfoBuilder<L, B, Unit>> config) -
serverboundProtocol
public static <T extends ServerboundPacketListener, B extends io.netty.buffer.ByteBuf> SimpleUnboundProtocol<T,B> serverboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, Unit>> config) -
clientboundProtocol
public static <T extends ClientboundPacketListener, B extends io.netty.buffer.ByteBuf> SimpleUnboundProtocol<T,B> clientboundProtocol(ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, Unit>> config) -
contextProtocol
private static <L extends PacketListener, B extends io.netty.buffer.ByteBuf, C> UnboundProtocol<L,B, contextProtocolC> (ConnectionProtocol id, PacketFlow flow, Consumer<ProtocolInfoBuilder<L, B, C>> config) -
contextServerboundProtocol
public static <T extends ServerboundPacketListener, B extends io.netty.buffer.ByteBuf, C> UnboundProtocol<T,B, contextServerboundProtocolC> (ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, C>> config) -
contextClientboundProtocol
public static <T extends ClientboundPacketListener, B extends io.netty.buffer.ByteBuf, C> UnboundProtocol<T,B, contextClientboundProtocolC> (ConnectionProtocol id, Consumer<ProtocolInfoBuilder<T, B, C>> config)
-