diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java index 7baf4b26..cc360515 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java @@ -332,16 +332,33 @@ public abstract class PacketAdapter implements PacketListener { * Construct a helper object for passing parameters to the packet adapter. *

* This is often simpler and better than passing them directly to each constructor. + *

+ * Deprecated: Use {@link #params(Plugin, PacketType...)} instead. * @param plugin - the plugin that spawned this listener. * @param packets - the packet IDs the listener is looking for. * @return Helper object. */ + @Deprecated public static AdapterParameteters params(Plugin plugin, Integer... packets) { return new AdapterParameteters().plugin(plugin).packets(packets); } + /** + * Construct a helper object for passing parameters to the packet adapter. + *

+ * This is often simpler and better than passing them directly to each constructor. + * @param plugin - the plugin that spawned this listener. + * @param packets - the packet types the listener is looking for. + * @return Helper object. + */ + public static AdapterParameteters params(Plugin plugin, PacketType... packets) { + return new AdapterParameteters().plugin(plugin).types(packets); + } + /** * Represents a builder for passing parameters to the packet adapter constructor. + *

+ * Note: Never make spelling mistakes in a public API! * @author Kristian */ public static class AdapterParameteters { 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 584419d1..a7f18d45 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 @@ -51,7 +51,7 @@ public class NettyProtocolInjector implements ChannelListener { private PacketTypeSet reveivedFilters = new PacketTypeSet(); // Which packets are buffered - private PacketTypeSet bufferedPackets; + private PacketTypeSet bufferedPackets = new PacketTypeSet(); private ListenerInvoker invoker; // Handle errors diff --git a/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java b/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java index 1ab03022..9f05fede 100644 --- a/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java +++ b/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java @@ -72,7 +72,7 @@ public class TestPingPacket { @Override public String call() throws Exception { SimpleMinecraftClient client = new SimpleMinecraftClient( - new MinecraftVersion(CRAFTBUKKIT_VERSION), PROTOCOL_VERSION); + new MinecraftVersion(CRAFTBUKKIT_VERSION), PROTOCOL_VERSION); String information = client.queryLocalPing(); // Wait for the listener to catch up