2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-09-16 14:08:02 +00:00

ignore IllegalStateException thrown by ServerConnection class in velocity

This commit is contained in:
mohammed jasem alaajel 2024-05-14 19:23:09 +04:00
parent 71287055b4
commit e8715e5399
Signed by: ham1255
GPG Key ID: EF343502046229F4

View File

@ -26,7 +26,6 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.server.ServerPing;
import net.kyori.adventure.text.Component;
import java.util.*;
import java.util.stream.Collectors;
@ -146,8 +145,11 @@ public class RedisBungeeListener {
return;
}
}
((ServerConnection) event.getSource()).sendPluginMessage(event.getIdentifier(), out.toByteArray());
try {
// ServerConnection throws IllegalStateException when connection dies somehow so just ignore :/
((ServerConnection) event.getSource()).sendPluginMessage(event.getIdentifier(), out.toByteArray());
} catch (IllegalStateException ignored) {
}
});
}