Skip to content

Commit cd2f56d

Browse files
committed
Update TinyProtocol to 1.12
1 parent 7c9bbc3 commit cd2f56d

File tree

3 files changed

+17
-33
lines changed

3 files changed

+17
-33
lines changed

modules/TinyProtocol/pom.xml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<parent>
1515
<groupId>com.comphenix.protocol</groupId>
1616
<artifactId>ProtocolLib-Parent</artifactId>
17-
<version>v3-SNAPSHOT</version>
18-
<relativePath>../</relativePath>
17+
<version>v4-SNAPSHOT</version>
18+
<relativePath>../../</relativePath>
1919
</parent>
2020

2121
<repositories>
@@ -42,8 +42,8 @@
4242
<artifactId>maven-compiler-plugin</artifactId>
4343
<version>3.0</version>
4444
<configuration>
45-
<source>1.7</source>
46-
<target>1.7</target>
45+
<source>1.8</source>
46+
<target>1.8</target>
4747
</configuration>
4848
</plugin>
4949

@@ -77,20 +77,6 @@
7777
</plugins>
7878
</build>
7979

80-
<dependencies>
81-
<dependency>
82-
<groupId>org.spigotmc</groupId>
83-
<artifactId>spigot-api</artifactId>
84-
<version>1.8.8-R0.1-SNAPSHOT</version>
85-
</dependency>
86-
<dependency>
87-
<groupId>org.spigotmc</groupId>
88-
<artifactId>spigot</artifactId>
89-
<version>1.8.8-R0.1-SNAPSHOT</version>
90-
<scope>provided</scope>
91-
</dependency>
92-
</dependencies>
93-
9480
<profiles>
9581
<profile>
9682
<id>release-sign-artifacts</id>

modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public boolean hasField(Object target) {
178178
}
179179

180180
/**
181-
* Search for the first publically and privately defined method of the given name and parameter count.
181+
* Search for the first publicly and privately defined method of the given name and parameter count.
182182
*
183183
* @param className - lookup name of the class, see {@link #getClass(String)}.
184184
* @param methodName - the method name, or NULL to skip.
@@ -191,7 +191,7 @@ public static MethodInvoker getMethod(String className, String methodName, Class
191191
}
192192

193193
/**
194-
* Search for the first publically and privately defined method of the given name and parameter count.
194+
* Search for the first publicly and privately defined method of the given name and parameter count.
195195
*
196196
* @param clazz - a class to start with.
197197
* @param methodName - the method name, or NULL to skip.
@@ -204,7 +204,7 @@ public static MethodInvoker getMethod(Class<?> clazz, String methodName, Class<?
204204
}
205205

206206
/**
207-
* Search for the first publically and privately defined method of the given name and parameter count.
207+
* Search for the first publicly and privately defined method of the given name and parameter count.
208208
*
209209
* @param clazz - a class to start with.
210210
* @param methodName - the method name, or NULL to skip.

modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/TinyProtocol.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public TinyProtocol(final Plugin plugin) {
105105
} catch (IllegalArgumentException ex) {
106106
// Damn you, late bind
107107
plugin.getLogger().info("[TinyProtocol] Delaying server channel injection due to late bind.");
108-
109-
// Damn you, late bind
108+
110109
new BukkitRunnable() {
111110
@Override
112111
public void run() {
@@ -129,7 +128,7 @@ protected void initChannel(Channel channel) throws Exception {
129128
synchronized (networkManagers) {
130129
// Stop injecting channels
131130
if (!closed) {
132-
injectChannelInternal(channel);
131+
channel.eventLoop().submit(() -> injectChannelInternal(channel));
133132
}
134133
}
135134
} catch (Exception e) {
@@ -256,13 +255,12 @@ private void registerPlayers(Plugin plugin) {
256255
* <p>
257256
* Note that this is not executed on the main thread.
258257
*
259-
* @param reciever - the receiving player, NULL for early login/status packets.
258+
* @param receiver - the receiving player, NULL for early login/status packets.
260259
* @param channel - the channel that received the packet. Never NULL.
261-
* @param remoteAddress - remote address of the sending client. Never NULL.
262260
* @param packet - the packet being sent.
263261
* @return The packet to send instead, or NULL to cancel the transmission.
264262
*/
265-
public Object onPacketOutAsync(Player reciever, Channel channel, Object packet) {
263+
public Object onPacketOutAsync(Player receiver, Channel channel, Object packet) {
266264
return packet;
267265
}
268266

@@ -283,7 +281,7 @@ public Object onPacketInAsync(Player sender, Channel channel, Object packet) {
283281
/**
284282
* Send a packet to a particular player.
285283
* <p>
286-
* Note that {@link #onPacketOutAsync(Player, Object)} will be invoked with this packet.
284+
* Note that {@link #onPacketOutAsync(Player, Channel, Object)} will be invoked with this packet.
287285
*
288286
* @param player - the destination player.
289287
* @param packet - the packet to send.
@@ -295,7 +293,7 @@ public void sendPacket(Player player, Object packet) {
295293
/**
296294
* Send a packet to a particular client.
297295
* <p>
298-
* Note that {@link #onPacketOutAsync(Player, Object)} will be invoked with this packet.
296+
* Note that {@link #onPacketOutAsync(Player, Channel, Object)} will be invoked with this packet.
299297
*
300298
* @param channel - client identified by a channel.
301299
* @param packet - the packet to send.
@@ -307,7 +305,7 @@ public void sendPacket(Channel channel, Object packet) {
307305
/**
308306
* Pretend that a given packet has been received from a player.
309307
* <p>
310-
* Note that {@link #onPacketInAsync(Player, Object)} will be invoked with this packet.
308+
* Note that {@link #onPacketInAsync(Player, Channel, Object)} will be invoked with this packet.
311309
*
312310
* @param player - the player that sent the packet.
313311
* @param packet - the packet that will be received by the server.
@@ -319,7 +317,7 @@ public void receivePacket(Player player, Object packet) {
319317
/**
320318
* Pretend that a given packet has been received from a given client.
321319
* <p>
322-
* Note that {@link #onPacketInAsync(Player, Object)} will be invoked with this packet.
320+
* Note that {@link #onPacketInAsync(Player, Channel, Object)} will be invoked with this packet.
323321
*
324322
* @param channel - client identified by a channel.
325323
* @param packet - the packet that will be received by the server.
@@ -353,7 +351,7 @@ public void injectPlayer(Player player) {
353351
/**
354352
* Add a custom channel handler to the given channel.
355353
*
356-
* @param player - the channel to inject.
354+
* @param channel - the channel to inject.
357355
* @return The intercepted channel, or NULL if it has already been injected.
358356
*/
359357
public void injectChannel(Channel channel) {
@@ -363,7 +361,7 @@ public void injectChannel(Channel channel) {
363361
/**
364362
* Add a custom channel handler to the given channel.
365363
*
366-
* @param player - the channel to inject.
364+
* @param channel - the channel to inject.
367365
* @return The packet interceptor.
368366
*/
369367
private PacketInterceptor injectChannelInternal(Channel channel) {

0 commit comments

Comments
 (0)