@@ -105,8 +105,7 @@ public TinyProtocol(final Plugin plugin) {
105
105
} catch (IllegalArgumentException ex ) {
106
106
// Damn you, late bind
107
107
plugin .getLogger ().info ("[TinyProtocol] Delaying server channel injection due to late bind." );
108
-
109
- // Damn you, late bind
108
+
110
109
new BukkitRunnable () {
111
110
@ Override
112
111
public void run () {
@@ -129,7 +128,7 @@ protected void initChannel(Channel channel) throws Exception {
129
128
synchronized (networkManagers ) {
130
129
// Stop injecting channels
131
130
if (!closed ) {
132
- injectChannelInternal (channel );
131
+ channel . eventLoop (). submit (() -> injectChannelInternal (channel ) );
133
132
}
134
133
}
135
134
} catch (Exception e ) {
@@ -256,13 +255,12 @@ private void registerPlayers(Plugin plugin) {
256
255
* <p>
257
256
* Note that this is not executed on the main thread.
258
257
*
259
- * @param reciever - the receiving player, NULL for early login/status packets.
258
+ * @param receiver - the receiving player, NULL for early login/status packets.
260
259
* @param channel - the channel that received the packet. Never NULL.
261
- * @param remoteAddress - remote address of the sending client. Never NULL.
262
260
* @param packet - the packet being sent.
263
261
* @return The packet to send instead, or NULL to cancel the transmission.
264
262
*/
265
- public Object onPacketOutAsync (Player reciever , Channel channel , Object packet ) {
263
+ public Object onPacketOutAsync (Player receiver , Channel channel , Object packet ) {
266
264
return packet ;
267
265
}
268
266
@@ -283,7 +281,7 @@ public Object onPacketInAsync(Player sender, Channel channel, Object packet) {
283
281
/**
284
282
* Send a packet to a particular player.
285
283
* <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.
287
285
*
288
286
* @param player - the destination player.
289
287
* @param packet - the packet to send.
@@ -295,7 +293,7 @@ public void sendPacket(Player player, Object packet) {
295
293
/**
296
294
* Send a packet to a particular client.
297
295
* <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.
299
297
*
300
298
* @param channel - client identified by a channel.
301
299
* @param packet - the packet to send.
@@ -307,7 +305,7 @@ public void sendPacket(Channel channel, Object packet) {
307
305
/**
308
306
* Pretend that a given packet has been received from a player.
309
307
* <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.
311
309
*
312
310
* @param player - the player that sent the packet.
313
311
* @param packet - the packet that will be received by the server.
@@ -319,7 +317,7 @@ public void receivePacket(Player player, Object packet) {
319
317
/**
320
318
* Pretend that a given packet has been received from a given client.
321
319
* <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.
323
321
*
324
322
* @param channel - client identified by a channel.
325
323
* @param packet - the packet that will be received by the server.
@@ -353,7 +351,7 @@ public void injectPlayer(Player player) {
353
351
/**
354
352
* Add a custom channel handler to the given channel.
355
353
*
356
- * @param player - the channel to inject.
354
+ * @param channel - the channel to inject.
357
355
* @return The intercepted channel, or NULL if it has already been injected.
358
356
*/
359
357
public void injectChannel (Channel channel ) {
@@ -363,7 +361,7 @@ public void injectChannel(Channel channel) {
363
361
/**
364
362
* Add a custom channel handler to the given channel.
365
363
*
366
- * @param player - the channel to inject.
364
+ * @param channel - the channel to inject.
367
365
* @return The packet interceptor.
368
366
*/
369
367
private PacketInterceptor injectChannelInternal (Channel channel ) {
0 commit comments