From cd2f56d7c78fba228912b875270a225764318a4e Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Wed, 14 Jun 2017 14:30:31 -0400 Subject: [PATCH] Update TinyProtocol to 1.12 --- modules/TinyProtocol/pom.xml | 22 ++++--------------- .../comphenix/tinyprotocol/Reflection.java | 6 ++--- .../comphenix/tinyprotocol/TinyProtocol.java | 22 +++++++++---------- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/modules/TinyProtocol/pom.xml b/modules/TinyProtocol/pom.xml index 027464f0..689e5d59 100644 --- a/modules/TinyProtocol/pom.xml +++ b/modules/TinyProtocol/pom.xml @@ -14,8 +14,8 @@ com.comphenix.protocol ProtocolLib-Parent - v3-SNAPSHOT - ../ + v4-SNAPSHOT + ../../ @@ -42,8 +42,8 @@ maven-compiler-plugin 3.0 - 1.7 - 1.7 + 1.8 + 1.8 @@ -77,20 +77,6 @@ - - - org.spigotmc - spigot-api - 1.8.8-R0.1-SNAPSHOT - - - org.spigotmc - spigot - 1.8.8-R0.1-SNAPSHOT - provided - - - release-sign-artifacts diff --git a/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java b/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java index 7cadf5af..14032a3f 100644 --- a/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java +++ b/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java @@ -178,7 +178,7 @@ public final class Reflection { } /** - * Search for the first publically and privately defined method of the given name and parameter count. + * Search for the first publicly and privately defined method of the given name and parameter count. * * @param className - lookup name of the class, see {@link #getClass(String)}. * @param methodName - the method name, or NULL to skip. @@ -191,7 +191,7 @@ public final class Reflection { } /** - * Search for the first publically and privately defined method of the given name and parameter count. + * Search for the first publicly and privately defined method of the given name and parameter count. * * @param clazz - a class to start with. * @param methodName - the method name, or NULL to skip. @@ -204,7 +204,7 @@ public final class Reflection { } /** - * Search for the first publically and privately defined method of the given name and parameter count. + * Search for the first publicly and privately defined method of the given name and parameter count. * * @param clazz - a class to start with. * @param methodName - the method name, or NULL to skip. diff --git a/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java b/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java index 0f17a55b..9d3e7de0 100644 --- a/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java +++ b/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java @@ -105,8 +105,7 @@ public abstract class TinyProtocol { } catch (IllegalArgumentException ex) { // Damn you, late bind plugin.getLogger().info("[TinyProtocol] Delaying server channel injection due to late bind."); - - // Damn you, late bind + new BukkitRunnable() { @Override public void run() { @@ -129,7 +128,7 @@ public abstract class TinyProtocol { synchronized (networkManagers) { // Stop injecting channels if (!closed) { - injectChannelInternal(channel); + channel.eventLoop().submit(() -> injectChannelInternal(channel)); } } } catch (Exception e) { @@ -256,13 +255,12 @@ public abstract class TinyProtocol { *

* Note that this is not executed on the main thread. * - * @param reciever - the receiving player, NULL for early login/status packets. + * @param receiver - the receiving player, NULL for early login/status packets. * @param channel - the channel that received the packet. Never NULL. - * @param remoteAddress - remote address of the sending client. Never NULL. * @param packet - the packet being sent. * @return The packet to send instead, or NULL to cancel the transmission. */ - public Object onPacketOutAsync(Player reciever, Channel channel, Object packet) { + public Object onPacketOutAsync(Player receiver, Channel channel, Object packet) { return packet; } @@ -283,7 +281,7 @@ public abstract class TinyProtocol { /** * Send a packet to a particular player. *

- * Note that {@link #onPacketOutAsync(Player, Object)} will be invoked with this packet. + * Note that {@link #onPacketOutAsync(Player, Channel, Object)} will be invoked with this packet. * * @param player - the destination player. * @param packet - the packet to send. @@ -295,7 +293,7 @@ public abstract class TinyProtocol { /** * Send a packet to a particular client. *

- * Note that {@link #onPacketOutAsync(Player, Object)} will be invoked with this packet. + * Note that {@link #onPacketOutAsync(Player, Channel, Object)} will be invoked with this packet. * * @param channel - client identified by a channel. * @param packet - the packet to send. @@ -307,7 +305,7 @@ public abstract class TinyProtocol { /** * Pretend that a given packet has been received from a player. *

- * Note that {@link #onPacketInAsync(Player, Object)} will be invoked with this packet. + * Note that {@link #onPacketInAsync(Player, Channel, Object)} will be invoked with this packet. * * @param player - the player that sent the packet. * @param packet - the packet that will be received by the server. @@ -319,7 +317,7 @@ public abstract class TinyProtocol { /** * Pretend that a given packet has been received from a given client. *

- * Note that {@link #onPacketInAsync(Player, Object)} will be invoked with this packet. + * Note that {@link #onPacketInAsync(Player, Channel, Object)} will be invoked with this packet. * * @param channel - client identified by a channel. * @param packet - the packet that will be received by the server. @@ -353,7 +351,7 @@ public abstract class TinyProtocol { /** * Add a custom channel handler to the given channel. * - * @param player - the channel to inject. + * @param channel - the channel to inject. * @return The intercepted channel, or NULL if it has already been injected. */ public void injectChannel(Channel channel) { @@ -363,7 +361,7 @@ public abstract class TinyProtocol { /** * Add a custom channel handler to the given channel. * - * @param player - the channel to inject. + * @param channel - the channel to inject. * @return The packet interceptor. */ private PacketInterceptor injectChannelInternal(Channel channel) {