mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Precreate the inputBuffers set, avoiding a trivial NPE.
This commit is contained in:
parent
348019c1e1
commit
be6d4fb720
@ -332,16 +332,33 @@ public abstract class PacketAdapter implements PacketListener {
|
|||||||
* Construct a helper object for passing parameters to the packet adapter.
|
* Construct a helper object for passing parameters to the packet adapter.
|
||||||
* <p>
|
* <p>
|
||||||
* This is often simpler and better than passing them directly to each constructor.
|
* This is often simpler and better than passing them directly to each constructor.
|
||||||
|
* <p>
|
||||||
|
* Deprecated: Use {@link #params(Plugin, PacketType...)} instead.
|
||||||
* @param plugin - the plugin that spawned this listener.
|
* @param plugin - the plugin that spawned this listener.
|
||||||
* @param packets - the packet IDs the listener is looking for.
|
* @param packets - the packet IDs the listener is looking for.
|
||||||
* @return Helper object.
|
* @return Helper object.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static AdapterParameteters params(Plugin plugin, Integer... packets) {
|
public static AdapterParameteters params(Plugin plugin, Integer... packets) {
|
||||||
return new AdapterParameteters().plugin(plugin).packets(packets);
|
return new AdapterParameteters().plugin(plugin).packets(packets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a helper object for passing parameters to the packet adapter.
|
||||||
|
* <p>
|
||||||
|
* 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.
|
* Represents a builder for passing parameters to the packet adapter constructor.
|
||||||
|
* <p>
|
||||||
|
* Note: Never make spelling mistakes in a public API!
|
||||||
* @author Kristian
|
* @author Kristian
|
||||||
*/
|
*/
|
||||||
public static class AdapterParameteters {
|
public static class AdapterParameteters {
|
||||||
|
@ -51,7 +51,7 @@ public class NettyProtocolInjector implements ChannelListener {
|
|||||||
private PacketTypeSet reveivedFilters = new PacketTypeSet();
|
private PacketTypeSet reveivedFilters = new PacketTypeSet();
|
||||||
|
|
||||||
// Which packets are buffered
|
// Which packets are buffered
|
||||||
private PacketTypeSet bufferedPackets;
|
private PacketTypeSet bufferedPackets = new PacketTypeSet();
|
||||||
private ListenerInvoker invoker;
|
private ListenerInvoker invoker;
|
||||||
|
|
||||||
// Handle errors
|
// Handle errors
|
||||||
|
@ -72,7 +72,7 @@ public class TestPingPacket {
|
|||||||
@Override
|
@Override
|
||||||
public String call() throws Exception {
|
public String call() throws Exception {
|
||||||
SimpleMinecraftClient client = new SimpleMinecraftClient(
|
SimpleMinecraftClient client = new SimpleMinecraftClient(
|
||||||
new MinecraftVersion(CRAFTBUKKIT_VERSION), PROTOCOL_VERSION);
|
new MinecraftVersion(CRAFTBUKKIT_VERSION), PROTOCOL_VERSION);
|
||||||
String information = client.queryLocalPing();
|
String information = client.queryLocalPing();
|
||||||
|
|
||||||
// Wait for the listener to catch up
|
// Wait for the listener to catch up
|
||||||
|
Loading…
Reference in New Issue
Block a user