diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java index 02b6139b..f75ced2f 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java @@ -485,20 +485,15 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector { } @Override - public void recieveClientPacket(final Object packet, final NetworkMarker marker, final boolean filtered) { + public void recieveClientPacket(final Object packet) { + // TODO: Ensure the packet listeners are executed in the channel thread. + // Execute this in the channel thread Runnable action = new Runnable() { @Override public void run() { - PacketEvent event = filtered ? channelListener.onPacketReceiving(ChannelInjector.this, packet, marker) : null; - Object result = event != null ? event.getPacket().getHandle() : packet; - - // See if the packet has been cancelled - if (event != null && event.isCancelled()) - return; - try { - MinecraftMethods.getNetworkManagerReadPacketMethod().invoke(networkManager, null, result); + MinecraftMethods.getNetworkManagerReadPacketMethod().invoke(networkManager, null, packet); } catch (Exception e) { // Inform the user ProtocolLibrary.getErrorReporter().reportMinimal(factory.getPlugin(), "recieveClientPacket", e); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ClosedInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ClosedInjector.java index e7287b7d..c65c97d2 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ClosedInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/ClosedInjector.java @@ -36,7 +36,7 @@ class ClosedInjector implements Injector { } @Override - public void recieveClientPacket(Object packet, NetworkMarker marker, boolean filtered) { + public void recieveClientPacket(Object packet) { // Do nothing } diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/Injector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/Injector.java index 2c836da1..6059019f 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/Injector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/Injector.java @@ -34,10 +34,8 @@ interface Injector { /** * Recieve a packet on the server. * @param packet - the (NMS) packet to send. - * @param marker - the network marker. - * @param filtered - whether or not the packet is filtered. */ - public abstract void recieveClientPacket(Object packet, NetworkMarker marker, boolean filtered); + public abstract void recieveClientPacket(Object packet); /** * Retrieve the current protocol state. diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolInjector.java index 7d9ab741..582f1045 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolInjector.java @@ -331,7 +331,7 @@ public class NettyProtocolInjector implements ChannelListener { @Override public void recieveClientPacket(Player player, Object mcPacket) throws IllegalAccessException, InvocationTargetException { injectionFactory.fromPlayer(player, listener). - recieveClientPacket(mcPacket, null, true); + recieveClientPacket(mcPacket); } @Override