use of net.minecraft.util.io.netty.channel.Channel in project packetevents by retrooper.
the class LateChannelInjectorLegacy method sendPacket.
@Override
public void sendPacket(Object rawChannel, Object packet) {
Channel channel = (Channel) rawChannel;
channel.pipeline().writeAndFlush(packet);
}
use of net.minecraft.util.io.netty.channel.Channel in project packetevents by retrooper.
the class EarlyChannelInjectorLegacy method sendPacket.
@Override
public void sendPacket(Object ch, Object rawNMSPacket) {
Channel channel = (Channel) ch;
channel.writeAndFlush(rawNMSPacket);
}
use of net.minecraft.util.io.netty.channel.Channel in project packetevents by retrooper.
the class EarlyChannelInjectorLegacy method flushPackets.
@Override
public void flushPackets(Object ch) {
Channel channel = (Channel) ch;
channel.flush();
}
use of net.minecraft.util.io.netty.channel.Channel in project packetevents by retrooper.
the class EarlyChannelInjectorLegacy method getHandler.
private PlayerChannelHandlerLegacy getHandler(Object rawChannel) {
Channel channel = (Channel) rawChannel;
ChannelHandler handler = channel.pipeline().get(PacketEvents.get().getHandlerName());
if (handler instanceof PlayerChannelHandlerLegacy) {
return (PlayerChannelHandlerLegacy) handler;
} else {
return null;
}
}
use of net.minecraft.util.io.netty.channel.Channel in project TheAPI by TheDevTec.
the class PacketHandler_Legacy method get.
public Channel get(Player player) {
Channel channel = channelLookup.get(player.getName());
if (channel == null) {
Object get = BukkitLoader.getNmsProvider().getNetworkChannel(BukkitLoader.getNmsProvider().getConnectionNetwork(BukkitLoader.getNmsProvider().getPlayerConnection(player)));
if (get == null)
return null;
channelLookup.put(player.getName(), channel = (Channel) get);
}
return channel;
}
Aggregations