public static void bind(Player player) {
Object entityPlayer = Conversion.toEntityHandle.convert(player);
Object playerConnection = EntityPlayerRef.playerConnection.get(entityPlayer);
Object networkManager = PlayerConnectionRef.networkManager.get(playerConnection);
Channel channel = NetworkManagerRef.channel.get(networkManager);
channel.pipeline().addBefore("packet_handler", "bkcommonlib", new CommonChannelListener(player));
}
public static void unbind(Player player) {
Object entityPlayer = Conversion.toEntityHandle.convert(player);
Object playerConnection = EntityPlayerRef.playerConnection.get(entityPlayer);