Skip to content

Commit 3781544

Browse files
author
UserNugget
committed
Don't fail login hook silently
1 parent f278636 commit 3781544

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

plugin/src/main/java/net/elytrium/limboapi/injection/event/EventManagerHook.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public EventTask onGameProfileRequest(GameProfileRequestEvent event) {
7777
this.plugin.getLoginListener().hookLoginSession(modifiedEvent);
7878
hookFuture.complete(modifiedEvent);
7979
} catch (Throwable e) {
80+
LimboAPI.getLogger().error("Failed to handle GameProfileRequestEvent", e);
8081
throw new ReflectionException(e);
8182
}
8283
});

plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ public void hookLoginSession(GameProfileRequestEvent event) throws Throwable {
266266
player.disconnect0(Component.translatable("velocity.error.already-connected-proxy", NamedTextColor.RED), true);
267267
}
268268
} catch (Throwable e) {
269-
throw new ReflectionException(e);
269+
inbound.getConnection().close();
270+
throw e;
270271
}
271272
}
272273
}

0 commit comments

Comments
 (0)