From 79c1e81c02a60fd71fa25d0b96b4588ad946941b Mon Sep 17 00:00:00 2001 From: Devil Boy Date: Wed, 4 Dec 2013 23:56:49 -0800 Subject: [PATCH 1/4] Deprecated a method that was accepting packet IDs Fixed a small typo --- .../java/com/comphenix/protocol/events/PacketAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 2dfbf4a4..501423e1 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java @@ -332,10 +332,12 @@ 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 #types(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); } @@ -383,7 +385,7 @@ public abstract class PacketAdapter implements PacketListener { } /** - * Set this adapter to also look for client-side packets. + * Set this adapter to also look for server-side packets. * @return This builder, for chaining. */ public AdapterParameteters serverSide() { From 9a658065e1a2e2ad2be3d52bb856ac64b6732c28 Mon Sep 17 00:00:00 2001 From: thesbros Date: Thu, 5 Dec 2013 10:48:42 -0800 Subject: [PATCH 2/4] Another --- .../src/main/java/com/comphenix/protocol/PacketType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java index 12946bf0..4c09eb84 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java @@ -196,7 +196,7 @@ public class PacketType implements Serializable { public static final PacketType HELD_ITEM_SLOT = new PacketType(PROTOCOL, SENDER, 0x09, 16); public static final PacketType ARM_ANIMATION = new PacketType(PROTOCOL, SENDER, 0x0A, 18); public static final PacketType ENTITY_ACTION = new PacketType(PROTOCOL, SENDER, 0x0B, 19); - public static final PacketType STEER_VECHICLE = new PacketType(PROTOCOL, SENDER, 0x0C, 27); + public static final PacketType STEER_VEHICLE = new PacketType(PROTOCOL, SENDER, 0x0C, 27); public static final PacketType CLOSE_WINDOW = new PacketType(PROTOCOL, SENDER, 0x0D, 101); public static final PacketType WINDOW_CLICK = new PacketType(PROTOCOL, SENDER, 0x0E, 102); public static final PacketType TRANSACTION = new PacketType(PROTOCOL, SENDER, 0x0F, 106); From a9dbca0bfbc6c6b1f31ea277d1872734cb39a456 Mon Sep 17 00:00:00 2001 From: Devil Boy Date: Thu, 5 Dec 2013 11:55:00 -0800 Subject: [PATCH 3/4] Renamed AdapterParmeteters to AdapterParameters Added a new .param(Plugin, PacketType...) method to replace deprecated Minor Javadoc edits --- .../protocol/events/PacketAdapter.java | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) 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 501423e1..1a6b1918 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketAdapter.java @@ -48,7 +48,7 @@ public abstract class PacketAdapter implements PacketListener { * Initialize a packet adapter using a collection of parameters. Use {@link #params()} to get an instance to this builder. * @param params - the parameters. */ - public PacketAdapter(@Nonnull AdapterParameteters params) { + public PacketAdapter(@Nonnull AdapterParameters params) { this( checkValidity(params).plugin, params.connectionSide, params.listenerPriority, params.gamePhase, params.options, params.packets @@ -324,29 +324,41 @@ public abstract class PacketAdapter implements PacketListener { * This is often simpler and better than passing them directly to each constructor. * @return Helper object. */ - public static AdapterParameteters params() { - return new AdapterParameteters(); + public static AdapterParameters params() { + return new AdapterParameters(); } /** * 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 #types(PacketType...)} instead. + * 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); + public static AdapterParameters params(Plugin plugin, Integer... packets) { + return new AdapterParameters().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 AdapterParameters params(Plugin plugin, PacketType... packets) { + return new AdapterParameters().plugin(plugin).types(packets); } /** * Represents a builder for passing parameters to the packet adapter constructor. * @author Kristian */ - public static class AdapterParameteters { + public static class AdapterParameters { private Plugin plugin; private ConnectionSide connectionSide; private PacketType[] packets; @@ -361,7 +373,7 @@ public abstract class PacketAdapter implements PacketListener { * @param plugin - the plugin. * @return This builder, for chaining. */ - public AdapterParameteters plugin(@Nonnull Plugin plugin) { + public AdapterParameters plugin(@Nonnull Plugin plugin) { this.plugin = Preconditions.checkNotNull(plugin, "plugin cannot be NULL."); return this; } @@ -371,7 +383,7 @@ public abstract class PacketAdapter implements PacketListener { * @param connectionSide - the new packet type. * @return This builder, for chaining. */ - public AdapterParameteters connectionSide(@Nonnull ConnectionSide connectionSide) { + public AdapterParameters connectionSide(@Nonnull ConnectionSide connectionSide) { this.connectionSide = Preconditions.checkNotNull(connectionSide, "connectionside cannot be NULL."); return this; } @@ -380,7 +392,7 @@ public abstract class PacketAdapter implements PacketListener { * Set this adapter to also look for client-side packets. * @return This builder, for chaining. */ - public AdapterParameteters clientSide() { + public AdapterParameters clientSide() { return connectionSide(ConnectionSide.add(connectionSide, ConnectionSide.CLIENT_SIDE)); } @@ -388,7 +400,7 @@ public abstract class PacketAdapter implements PacketListener { * Set this adapter to also look for server-side packets. * @return This builder, for chaining. */ - public AdapterParameteters serverSide() { + public AdapterParameters serverSide() { return connectionSide(ConnectionSide.add(connectionSide, ConnectionSide.SERVER_SIDE)); } @@ -399,7 +411,7 @@ public abstract class PacketAdapter implements PacketListener { * @param listenerPriority - the new event priority. * @return This builder, for chaining. */ - public AdapterParameteters listenerPriority(@Nonnull ListenerPriority listenerPriority) { + public AdapterParameters listenerPriority(@Nonnull ListenerPriority listenerPriority) { this.listenerPriority = Preconditions.checkNotNull(listenerPriority, "listener priority cannot be NULL."); return this; } @@ -411,7 +423,7 @@ public abstract class PacketAdapter implements PacketListener { * @param gamePhase - the new game phase. * @return This builder, for chaining. */ - public AdapterParameteters gamePhase(@Nonnull GamePhase gamePhase) { + public AdapterParameters gamePhase(@Nonnull GamePhase gamePhase) { this.gamePhase = Preconditions.checkNotNull(gamePhase, "gamePhase cannot be NULL."); return this; } @@ -420,7 +432,7 @@ public abstract class PacketAdapter implements PacketListener { * Set the game phase to {@link GamePhase#LOGIN}, allowing ProtocolLib to intercept login packets. * @return This builder, for chaining. */ - public AdapterParameteters loginPhase() { + public AdapterParameters loginPhase() { return gamePhase(GamePhase.LOGIN); } @@ -431,7 +443,7 @@ public abstract class PacketAdapter implements PacketListener { * @param options - every option to use. * @return This builder, for chaining. */ - public AdapterParameteters options(@Nonnull ListenerOptions... options) { + public AdapterParameters options(@Nonnull ListenerOptions... options) { this.options = Preconditions.checkNotNull(options, "options cannot be NULL."); return this; } @@ -440,7 +452,7 @@ public abstract class PacketAdapter implements PacketListener { * Set the listener option to {@link ListenerOptions#INTERCEPT_INPUT_BUFFER}, causing ProtocolLib to read the raw packet data from the network stream. * @return This builder, for chaining. */ - public AdapterParameteters optionIntercept() { + public AdapterParameters optionIntercept() { return options(ListenerOptions.INTERCEPT_INPUT_BUFFER); } @@ -454,7 +466,7 @@ public abstract class PacketAdapter implements PacketListener { * @return This builder, for chaining. */ @Deprecated - public AdapterParameteters packets(@Nonnull Integer... packets) { + public AdapterParameters packets(@Nonnull Integer... packets) { Preconditions.checkNotNull(packets, "packets cannot be NULL"); PacketType[] types = new PacketType[packets.length]; @@ -473,7 +485,7 @@ public abstract class PacketAdapter implements PacketListener { * @return This builder, for chaining. */ @Deprecated - public AdapterParameteters packets(@Nonnull Set packets) { + public AdapterParameters packets(@Nonnull Set packets) { return packets(packets.toArray(new Integer[0])); } @@ -481,10 +493,10 @@ public abstract class PacketAdapter implements PacketListener { * Set the packet types the listener is looking for. *

* This parameter is required. - * @param packets + * @param packets - the packet types to look for. * @return This builder, for chaining. */ - public AdapterParameteters types(@Nonnull PacketType... packets) { + public AdapterParameters types(@Nonnull PacketType... packets) { this.packets = Preconditions.checkNotNull(packets, "packets cannot be NULL"); return this; } @@ -493,10 +505,10 @@ public abstract class PacketAdapter implements PacketListener { * Set the packet types the listener is looking for. *

* This parameter is required. - * @param packets + * @param packets - a set of packet types to look for. * @return This builder, for chaining. */ - public AdapterParameteters types(@Nonnull Set packets) { + public AdapterParameters types(@Nonnull Set packets) { return types(packets.toArray(new PacketType[0])); } } @@ -504,7 +516,7 @@ public abstract class PacketAdapter implements PacketListener { /** * Determine if the required parameters are set. */ - private static AdapterParameteters checkValidity(AdapterParameteters params) { + private static AdapterParameters checkValidity(AdapterParameters params) { if (params == null) throw new IllegalArgumentException("params cannot be NULL."); if (params.plugin == null) From 7d8d8ead08ba43591218534838059ca99ed07c30 Mon Sep 17 00:00:00 2001 From: Devil Boy Date: Thu, 5 Dec 2013 12:24:31 -0800 Subject: [PATCH 4/4] Fixed a few trivial spelling errors --- .../protocol/AsynchronousManager.java | 6 ++--- .../com/comphenix/protocol/PacketStream.java | 12 +++++----- .../com/comphenix/protocol/PacketType.java | 10 ++++---- .../comphenix/protocol/ProtocolManager.java | 24 +++++++++---------- .../protocol/async/AsyncFilterManager.java | 4 ++-- .../AbstractConcurrentListenerMultimap.java | 4 ++-- .../protocol/events/MonitorAdapter.java | 2 +- .../protocol/events/PacketListener.java | 6 ++--- .../injector/DelayedPacketManager.java | 14 +++++------ .../injector/PacketFilterManager.java | 10 ++++---- .../injector/netty/ChannelInjector.java | 2 +- .../injector/netty/NettyProtocolInjector.java | 10 ++++---- .../injector/packet/CaptureInputStream.java | 2 +- .../injector/packet/ProxyPacketInjector.java | 2 +- .../player/PlayerInjectionHandler.java | 14 +++++------ .../player/ProxyPlayerInjectionHandler.java | 12 +++++----- .../injector/spigot/DummyPlayerHandler.java | 4 ++-- .../injector/spigot/SpigotPacketInjector.java | 16 ++++++------- 18 files changed, 77 insertions(+), 77 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/AsynchronousManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/AsynchronousManager.java index 66bec542..c722da39 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/AsynchronousManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/AsynchronousManager.java @@ -39,8 +39,8 @@ public interface AsynchronousManager { * Use {@link AsyncMarker#incrementProcessingDelay()} to delay a packet until its ready to be transmitted. *

* To start listening asynchronously, pass the getListenerLoop() runnable to a different thread. - * @param listener - the packet listener that will recieve these asynchronous events. - * @return An asynchrouns handler. + * @param listener - the packet listener that will receive these asynchronous events. + * @return An asynchronous handler. */ public abstract AsyncListenerHandler registerAsyncHandler(PacketListener listener); @@ -84,7 +84,7 @@ public interface AsynchronousManager { public abstract Set getReceivingFilters(); /** - * Retrieves a immutable set containing the types of the recieved client packets that will be + * Retrieves a immutable set containing the types of the received client packets that will be * observed by the asynchronous listeners. * @return Every filtered client packet. */ diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketStream.java b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketStream.java index d5f9b83a..6ffd3710 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketStream.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketStream.java @@ -33,32 +33,32 @@ import com.comphenix.protocol.events.PacketContainer; public interface PacketStream { /** * Send a packet to the given player. - * @param reciever - the reciever. + * @param receiver - the reciever. * @param packet - packet to send. * @throws InvocationTargetException - if an error occured when sending the packet. */ - public void sendServerPacket(Player reciever, PacketContainer packet) + public void sendServerPacket(Player receiver, PacketContainer packet) throws InvocationTargetException; /** * Send a packet to the given player. - * @param reciever - the reciever. + * @param receiver - the reciever. * @param packet - packet to send. * @param filters - whether or not to invoke any packet filters below {@link ListenerPriority#MONITOR}. * @throws InvocationTargetException - if an error occured when sending the packet. */ - public void sendServerPacket(Player reciever, PacketContainer packet, boolean filters) + public void sendServerPacket(Player receiver, PacketContainer packet, boolean filters) throws InvocationTargetException; /** * Send a packet to the given player. - * @param reciever - the reciever. + * @param receiver - the receiver. * @param packet - packet to send. * @param marker - the network marker to use. * @param filters - whether or not to invoke any packet filters below {@link ListenerPriority#MONITOR}. * @throws InvocationTargetException - if an error occured when sending the packet. */ - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException; diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java index 4c09eb84..cd814712 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java @@ -85,7 +85,7 @@ public class PacketType implements Serializable { } /** - * Packets sent and recieved when logged into the game. + * Packets sent and received when logged into the game. * @author Kristian */ public static class Play { @@ -228,7 +228,7 @@ public class PacketType implements Serializable { } /** - * Packets sent and recieved when querying the server in the multiplayer menu. + * Packets sent and received when querying the server in the multiplayer menu. * @author Kristian */ public static class Status { @@ -280,7 +280,7 @@ public class PacketType implements Serializable { } /** - * Packets sent and recieved when logging in to the server. + * Packets sent and received when logging in to the server. * @author Kristian */ public static class Login { @@ -363,7 +363,7 @@ public class PacketType implements Serializable { } /** - * Represens the sender of this packet type. + * Represents the sender of this packet type. * @author Kristian * */ @@ -488,7 +488,7 @@ public class PacketType implements Serializable { * Note that the registration will be performed on the main thread. * @param type - the type to register. * @param name - the name of the packet. - * @return A future telling us if our instance was registrered. + * @return A future telling us if our instance was registered. */ public static Future scheduleRegister(final PacketType type, final String name) { Callable callable = new Callable() { diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolManager.java index 5d92c700..52ce735c 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolManager.java @@ -45,22 +45,22 @@ public interface ProtocolManager extends PacketStream { /** * Send a packet to the given player. *

- * Re-sending a previously cancelled packet is discuraged. Use {@link AsyncMarker#incrementProcessingDelay()} + * Re-sending a previously cancelled packet is discouraged. Use {@link AsyncMarker#incrementProcessingDelay()} * to delay a packet until a certain condition has been met. * - * @param reciever - the reciever. + * @param receiver - the receiver. * @param packet - packet to send. * @param filters - whether or not to invoke any packet filters below {@link ListenerPriority#MONITOR}. - * @throws InvocationTargetException - if an error occured when sending the packet. + * @throws InvocationTargetException - if an error occurred when sending the packet. */ @Override - public void sendServerPacket(Player reciever, PacketContainer packet, boolean filters) + public void sendServerPacket(Player receiver, PacketContainer packet, boolean filters) throws InvocationTargetException; /** - * Simulate recieving a certain packet from a given player. + * Simulate receiving a certain packet from a given player. *

- * Receiving a previously cancelled packet is discuraged. Use {@link AsyncMarker#incrementProcessingDelay()} + * Receiving a previously cancelled packet is discouraged. Use {@link AsyncMarker#incrementProcessingDelay()} * to delay a packet until a certain condition has been met. * * @param sender - the sender. @@ -81,7 +81,7 @@ public interface ProtocolManager extends PacketStream { public void broadcastServerPacket(PacketContainer packet); /** - * Broadcast a packet to every player that is recieving information about a given entity. + * Broadcast a packet to every player that is receiving information about a given entity. *

* This is usually every player in the same world within an observable distance. If the entity is a * player, it will only be included if includeTracker is TRUE. @@ -240,7 +240,7 @@ public interface ProtocolManager extends PacketStream { public Set getSendingFilterTypes(); /** - * Retrieves a immutable set containing the ID of the recieved client packets that will be observed by listeners. + * Retrieves a immutable set containing the ID of the received client packets that will be observed by listeners. *

* Deprecated: Use {@link #getReceivingFilterTypes()} instead. * @return Every filtered client packet. @@ -249,7 +249,7 @@ public interface ProtocolManager extends PacketStream { public Set getReceivingFilters(); /** - * Retrieves a immutable set containing the type of the recieved client packets that will be observed by listeners. + * Retrieves a immutable set containing the type of the received client packets that will be observed by listeners. * @return Every filtered client packet. */ public Set getReceivingFilterTypes(); @@ -261,14 +261,14 @@ public interface ProtocolManager extends PacketStream { public MinecraftVersion getMinecraftVersion(); /** - * Determines whether or not this protocol mananger has been disabled. + * Determines whether or not this protocol manager has been disabled. * @return TRUE if it has, FALSE otherwise. */ public boolean isClosed(); /** - * Retrieve the current asyncronous packet manager. - * @return Asyncronous packet manager. + * Retrieve the current asynchronous packet manager. + * @return Asynchronous packet manager. */ public AsynchronousManager getAsynchronousManager(); } \ No newline at end of file diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java index 119048b1..58691dcb 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/async/AsyncFilterManager.java @@ -152,9 +152,9 @@ public class AsyncFilterManager implements AsynchronousManager { * Asynchronous events will only be executed if a synchronous listener with the same packets is registered. * If you already have a synchronous event, call this method with autoInject set to FALSE. * - * @param listener - the packet listener that will recieve these asynchronous events. + * @param listener - the packet listener that will receive these asynchronous events. * @param autoInject - whether or not to automatically create the corresponding synchronous listener, - * @return An asynchrouns handler. + * @return An asynchronous handler. */ public AsyncListenerHandler registerAsyncHandler(PacketListener listener, boolean autoInject) { AsyncListenerHandler handler = new AsyncListenerHandler(mainThread, this, listener); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/AbstractConcurrentListenerMultimap.java b/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/AbstractConcurrentListenerMultimap.java index 26dc08f0..589972fa 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/AbstractConcurrentListenerMultimap.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/AbstractConcurrentListenerMultimap.java @@ -43,8 +43,8 @@ public abstract class AbstractConcurrentListenerMultimap { } /** - * Adds a listener to its requested list of packet recievers. - * @param listener - listener with a list of packets to recieve notifcations for. + * Adds a listener to its requested list of packet receivers. + * @param listener - listener with a list of packets to receive notifications for. * @param whitelist - the packet whitelist to use. */ public void addListener(TListener listener, ListeningWhitelist whitelist) { diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/MonitorAdapter.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/MonitorAdapter.java index ae535b83..5cd6b05f 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/MonitorAdapter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/MonitorAdapter.java @@ -32,7 +32,7 @@ import com.comphenix.protocol.injector.packet.PacketRegistry; import com.comphenix.protocol.reflect.FieldAccessException; /** - * Represents a listener that is notified of every sent and recieved packet. + * Represents a listener that is notified of every sent and received packet. * * @author Kristian */ diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketListener.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketListener.java index a5f9050b..c888d8fc 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketListener.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketListener.java @@ -20,7 +20,7 @@ package com.comphenix.protocol.events; import org.bukkit.plugin.Plugin; /** - * Represents a listener that recieves notifications when packets are sent or recieved. + * Represents a listener that receives notifications when packets are sent or received. *

* Use {@link PacketAdapter} for a simple wrapper around this interface. * @author Kristian @@ -39,13 +39,13 @@ public interface PacketListener { public void onPacketSending(PacketEvent event); /** - * Invoked right before a recieved packet from a client is being processed. + * Invoked right before a received packet from a client is being processed. *

* WARNING:
* This method will be called asynchronously! You should synchronize with the main * thread using {@link org.bukkit.scheduler.BukkitScheduler#scheduleSyncDelayedTask(Plugin, Runnable, long) scheduleSyncDelayedTask} * if you need to call the Bukkit API. - * @param event - the packet that has been recieved. + * @param event - the packet that has been received. */ public void onPacketReceiving(PacketEvent event); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/DelayedPacketManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/DelayedPacketManager.java index dcba0728..103b61a8 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/DelayedPacketManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/DelayedPacketManager.java @@ -176,21 +176,21 @@ public class DelayedPacketManager implements ProtocolManager, InternalManager { } @Override - public void sendServerPacket(Player reciever, PacketContainer packet) throws InvocationTargetException { - sendServerPacket(reciever, packet, null, true); + public void sendServerPacket(Player receiver, PacketContainer packet) throws InvocationTargetException { + sendServerPacket(receiver, packet, null, true); } @Override - public void sendServerPacket(Player reciever, PacketContainer packet, boolean filters) throws InvocationTargetException { - sendServerPacket(reciever, packet, null, filters); + public void sendServerPacket(Player receiver, PacketContainer packet, boolean filters) throws InvocationTargetException { + sendServerPacket(receiver, packet, null, filters); } @Override - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { if (delegate != null) { - delegate.sendServerPacket(reciever, packet, marker, filters); + delegate.sendServerPacket(receiver, packet, marker, filters); } else { - queuedActions.add(queuedAddPacket(ConnectionSide.SERVER_SIDE, reciever, packet, marker, filters)); + queuedActions.add(queuedAddPacket(ConnectionSide.SERVER_SIDE, receiver, packet, marker, filters)); } } diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java index e1d65c3e..87c95c74 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java @@ -738,9 +738,9 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok } @Override - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { - if (reciever == null) - throw new IllegalArgumentException("reciever cannot be NULL."); + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + if (receiver == null) + throw new IllegalArgumentException("receiver cannot be NULL."); if (packet == null) throw new IllegalArgumentException("packet cannot be NULL."); // We may have to enable player injection indefinitely after this @@ -749,13 +749,13 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok // Inform the MONITOR packets if (!filters) { - PacketEvent event = PacketEvent.fromServer(this, packet, marker, reciever); + PacketEvent event = PacketEvent.fromServer(this, packet, marker, receiver); sendingListeners.invokePacketSending( reporter, event, ListenerPriority.MONITOR); marker = NetworkMarker.getNetworkMarker(event); } - playerInjection.sendServerPacket(reciever, packet, marker, filters); + playerInjection.sendServerPacket(receiver, packet, marker, filters); } @Override 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 09c44c51..3f498011 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 @@ -428,7 +428,7 @@ class ChannelInjector extends ByteToMessageDecoder { try { MinecraftMethods.getNetworkManagerReadPacketMethod().invoke(networkManager, null, packet); } catch (Exception e) { - throw new IllegalArgumentException("Unable to recieve client packet " + packet, e); + throw new IllegalArgumentException("Unable to receive client packet " + packet, e); } } 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..dcf3d5c4 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 @@ -224,11 +224,11 @@ public class NettyProtocolInjector implements ChannelListener { /** * Called to inform the event listeners of a queued packet. * @param packet - the packet that is to be sent. - * @param reciever - the reciever of this packet. + * @param receiver - the receiver of this packet. * @return The packet event that was used. */ - private PacketEvent packetQueued(PacketContainer packet, Player reciever) { - PacketEvent event = PacketEvent.fromServer(this, packet, reciever); + private PacketEvent packetQueued(PacketContainer packet, Player receiver) { + PacketEvent event = PacketEvent.fromServer(this, packet, receiver); invoker.invokePacketSending(event); return event; @@ -270,8 +270,8 @@ public class NettyProtocolInjector implements ChannelListener { } @Override - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { - ChannelInjector.fromPlayer(reciever, listener). + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + ChannelInjector.fromPlayer(receiver, listener). sendServerPacket(packet.getHandle(), marker, filters); } diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/CaptureInputStream.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/CaptureInputStream.java index c42e0034..372b79ae 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/CaptureInputStream.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/CaptureInputStream.java @@ -55,7 +55,7 @@ class CaptureInputStream extends FilterInputStream { } /** - * Retrieve the output stream that recieves all the read information. + * Retrieve the output stream that receives all the read information. * @return The output stream everything is copied to. */ public OutputStream getOutputStream() { diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/ProxyPacketInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/ProxyPacketInjector.java index 1569d57d..ceea1e06 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/ProxyPacketInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/packet/ProxyPacketInjector.java @@ -51,7 +51,7 @@ import com.comphenix.protocol.utility.MinecraftReflection; import com.comphenix.protocol.wrappers.WrappedIntHashMap; /** - * This class is responsible for adding or removing proxy objects that intercepts recieved packets. + * This class is responsible for adding or removing proxy objects that intercepts received packets. * * @author Kristian */ diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java index b80cde31..e4fd780d 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/PlayerInjectionHandler.java @@ -114,14 +114,14 @@ public interface PlayerInjectionHandler { public abstract boolean uninjectPlayer(InetSocketAddress address); /** - * Send the given packet to the given reciever. - * @param reciever - the player receiver. + * Send the given packet to the given receiver. + * @param receiver - the player receiver. * @param packet - the packet to send. * @param marker * @param filters - whether or not to invoke the packet filters. - * @throws InvocationTargetException If an error occured during sending. + * @throws InvocationTargetException If an error occurred during sending. */ - public abstract void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) + public abstract void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException; /** @@ -161,14 +161,14 @@ public interface PlayerInjectionHandler { public abstract Set getSendingFilters(); /** - * Whether or not this player injection handler can also recieve packets. + * Whether or not this player injection handler can also receive packets. * @return TRUE if it can, FALSE otherwise. */ public abstract boolean canRecievePackets(); /** - * Invoked if this player injection handler can process recieved packets. - * @param packet - the recieved packet. + * Invoked if this player injection handler can process received packets. + * @param packet - the received packet. * @param input - the input stream. * @param buffered - the buffered packet. * @return The packet event. diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java index 0d1eaceb..8a7d60b5 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java @@ -523,15 +523,15 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler { } /** - * Send the given packet to the given reciever. - * @param reciever - the player receiver. + * Send the given packet to the given receiver. + * @param receiver - the player receiver. * @param packet - the packet to send. * @param filters - whether or not to invoke the packet filters. * @throws InvocationTargetException If an error occured during sending. */ @Override - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { - SocketInjector injector = getInjector(reciever); + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + SocketInjector injector = getInjector(receiver); // Send the packet, or drop it completely if (injector != null) { @@ -539,7 +539,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler { } else { throw new PlayerLoggedOutException(String.format( "Unable to send packet %s (%s): Player %s has logged out.", - packet.getType(), packet, reciever + packet.getType(), packet, receiver )); } } @@ -652,7 +652,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler { @Override public PacketEvent handlePacketRecieved(PacketContainer packet, InputStream input, byte[] buffered) { - throw new UnsupportedOperationException("Proxy injection cannot handle recieved packets."); + throw new UnsupportedOperationException("Proxy injection cannot handle received packets."); } /** diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/DummyPlayerHandler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/DummyPlayerHandler.java index 68c3b793..3f9878b7 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/DummyPlayerHandler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/DummyPlayerHandler.java @@ -35,8 +35,8 @@ class DummyPlayerHandler extends AbstractPlayerHandler { } @Override - public void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { - injector.sendServerPacket(reciever, packet, marker, filters); + public void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + injector.sendServerPacket(receiver, packet, marker, filters); } @Override diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java index 2d6d739b..dab0b96e 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java @@ -449,9 +449,9 @@ public class SpigotPacketInjector implements SpigotPacketListener { return packet; } - Player reciever = getInjector(networkManager, connection).getUpdatedPlayer(); + Player receiver = getInjector(networkManager, connection).getUpdatedPlayer(); PacketContainer container = new PacketContainer(id, packet); - PacketEvent event = packetQueued(container, reciever); + PacketEvent event = packetQueued(container, receiver); if (!event.isCancelled()) return event.getPacket().getHandle(); @@ -465,11 +465,11 @@ public class SpigotPacketInjector implements SpigotPacketListener { /** * Called to inform the event listeners of a queued packet. * @param packet - the packet that is to be sent. - * @param reciever - the reciever of this packet. + * @param receiver - the receiver of this packet. * @return The packet event that was used. */ - PacketEvent packetQueued(PacketContainer packet, Player reciever) { - PacketEvent event = PacketEvent.fromServer(this, packet, reciever); + PacketEvent packetQueued(PacketContainer packet, Player receiver) { + PacketEvent event = PacketEvent.fromServer(this, packet, receiver); invoker.invokePacketSending(event); return event; @@ -537,14 +537,14 @@ public class SpigotPacketInjector implements SpigotPacketListener { } /** * Invoked when a plugin wants to sent a packet. - * @param reciever - the packet receiver. + * @param receiver - the packet receiver. * @param packet - the packet to transmit. * @param marker - the network marker object. * @param filters - whether or not to invoke the packet listeners. * @throws InvocationTargetException If anything went wrong. */ - void sendServerPacket(Player reciever, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { - NetworkObjectInjector networkObject = getInjector(reciever, true); + void sendServerPacket(Player receiver, PacketContainer packet, NetworkMarker marker, boolean filters) throws InvocationTargetException { + NetworkObjectInjector networkObject = getInjector(receiver, true); // If TRUE, process this packet like any other if (filters)