From a8269e78679232fb847906dbd91db3b35c96c118 Mon Sep 17 00:00:00 2001 From: filoghost Date: Sun, 27 Feb 2022 10:10:18 +0100 Subject: [PATCH] Try to avoid error when player disconnects before packet listener is injected --- .../holographicdisplays/nms/v1_10_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_11_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_12_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_13_R2/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_14_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_15_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_16_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_16_R2/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_16_R3/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_17_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_18_R1/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_8_R3/VersionNMSManager.java | 3 +++ .../holographicdisplays/nms/v1_9_R2/VersionNMSManager.java | 3 +++ 13 files changed, 39 insertions(+) diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionNMSManager.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionNMSManager.java index 1a7d3e88..f24abff5 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionNMSManager.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionNMSManager.java @@ -117,6 +117,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java index 54cf7fd1..aa919db6 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java @@ -117,6 +117,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java index d8539f00..13bedaca 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java @@ -117,6 +117,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java index cef9a393..1c506707 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java @@ -117,6 +117,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java index df9a6b84..94a7cffe 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java @@ -102,6 +102,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java index 692267cd..ec6dd8b7 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java @@ -102,6 +102,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java index 71f9f864..40da3f32 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java @@ -102,6 +102,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionNMSManager.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionNMSManager.java index e6ac5be1..201c462c 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionNMSManager.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionNMSManager.java @@ -102,6 +102,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionNMSManager.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionNMSManager.java index 4bd470f0..79dbc0ab 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionNMSManager.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionNMSManager.java @@ -102,6 +102,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionNMSManager.java b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionNMSManager.java index f5e1433c..81ec682d 100644 --- a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionNMSManager.java +++ b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionNMSManager.java @@ -101,6 +101,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.k; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_18_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_18_R1/VersionNMSManager.java b/nms/v1_18_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_18_R1/VersionNMSManager.java index 88716255..561f908c 100644 --- a/nms/v1_18_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_18_R1/VersionNMSManager.java +++ b/nms/v1_18_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_18_R1/VersionNMSManager.java @@ -101,6 +101,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.k; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionNMSManager.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionNMSManager.java index 67ce66c9..e9ded51c 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionNMSManager.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionNMSManager.java @@ -114,6 +114,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) { diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionNMSManager.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionNMSManager.java index 313474b4..8f2a0ada 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionNMSManager.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionNMSManager.java @@ -117,6 +117,9 @@ public class VersionNMSManager implements NMSManager { Channel channel = networkManager.channel; channel.eventLoop().execute(() -> { + if (!player.isOnline()) { + return; + } try { pipelineModifierTask.accept(channel.pipeline()); } catch (Exception e) {