more connection fail reasons on bungee
This commit is contained in:
+21
-3
@@ -121,9 +121,27 @@ public class VelocityPlayer implements AdaptedPlayer, Audience {
|
|||||||
result -> {
|
result -> {
|
||||||
if(!result.isSuccessful()) {
|
if(!result.isSuccessful()) {
|
||||||
QueueMain main = QueueMain.getInstance();
|
QueueMain main = QueueMain.getInstance();
|
||||||
Component reason = result.getReasonComponent().orElseGet(
|
Component reason = result.getReasonComponent().orElse(null);
|
||||||
() -> Component.text("Connection failed")
|
if(reason == null) {
|
||||||
);
|
switch (result.getStatus()) {
|
||||||
|
case SUCCESS:
|
||||||
|
reason = Component.text("Success");
|
||||||
|
break;
|
||||||
|
case ALREADY_CONNECTED:
|
||||||
|
reason = Component.text("Already connected");
|
||||||
|
break;
|
||||||
|
case CONNECTION_IN_PROGRESS:
|
||||||
|
reason = Component.text("Already connecting");
|
||||||
|
break;
|
||||||
|
case CONNECTION_CANCELLED:
|
||||||
|
reason = Component.text("Connection canceled");
|
||||||
|
break;
|
||||||
|
case SERVER_DISCONNECTED:
|
||||||
|
reason = Component.text("Connection failed with unknown reason");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(main.getConfig().getBoolean("velocity-kick-message")) {
|
if(main.getConfig().getBoolean("velocity-kick-message")) {
|
||||||
handle.sendMessage(
|
handle.sendMessage(
|
||||||
main.getMessages().getComponent(
|
main.getMessages().getComponent(
|
||||||
|
|||||||
Reference in New Issue
Block a user