minecraft-src/net/minecraft/network/ProtocolSwapHandler.java
2025-07-04 01:41:11 +03:00

21 lines
788 B
Java

package net.minecraft.network;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.protocol.Packet;
public interface ProtocolSwapHandler {
static void handleInboundTerminalPacket(ChannelHandlerContext context, Packet<?> packet) {
if (packet.isTerminal()) {
context.channel().config().setAutoRead(false);
context.pipeline().addBefore(context.name(), "inbound_config", new UnconfiguredPipelineHandler.Inbound());
context.pipeline().remove(context.name());
}
}
static void handleOutboundTerminalPacket(ChannelHandlerContext context, Packet<?> packet) {
if (packet.isTerminal()) {
context.pipeline().addAfter(context.name(), "outbound_config", new UnconfiguredPipelineHandler.Outbound());
context.pipeline().remove(context.name());
}
}
}