diff options
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/LimboAuth.java')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index 530076a..4ea4659 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -386,6 +386,8 @@ public class LimboAuth { RegisteredPlayer registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, nickname); boolean onlineMode = player.isOnlineMode(); + boolean onlineModePassed = false; + if (onlineMode || isFloodgate) { if (registeredPlayer == null || registeredPlayer.getHash().isEmpty()) { registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, player.getUniqueId()); @@ -422,8 +424,7 @@ public class LimboAuth { } }); - this.factory.passLoginLimbo(player); - return; + onlineModePassed = true; } } } @@ -433,7 +434,13 @@ public class LimboAuth { this.server.getEventManager().fire(new PreRegisterEvent(player, eventConsumer)).thenAcceptAsync(eventConsumer); } else { Consumer<TaskEvent> eventConsumer = (event) -> this.sendPlayer(event, ((PreAuthorizationEvent) event).getPlayerInfo()); - this.server.getEventManager().fire(new PreAuthorizationEvent(player, registeredPlayer, eventConsumer)).thenAcceptAsync(eventConsumer); + TaskEvent event = new PreAuthorizationEvent(player, registeredPlayer, eventConsumer); + + if (onlineModePassed) { + event.setResult(TaskEvent.Result.BYPASS); + } + + this.server.getEventManager().fire(event).thenAcceptAsync(eventConsumer); } } |