Try to avoid error when player disconnects before packet listener is injected

This commit is contained in:
filoghost 2022-02-27 10:10:18 +01:00
parent cb12515755
commit a8269e7867
13 changed files with 39 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {