File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
core/src/main/java/org/geysermc/geyser/session Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 4040import lombok .Setter ;
4141import lombok .experimental .Accessors ;
4242import net .kyori .adventure .key .Key ;
43+ import net .raphimc .minecraftauth .responsehandler .exception .MinecraftRequestException ;
4344import net .raphimc .minecraftauth .step .java .StepMCProfile ;
4445import net .raphimc .minecraftauth .step .java .StepMCToken ;
4546import net .raphimc .minecraftauth .step .java .session .StepFullJavaSession ;
231232import java .util .Set ;
232233import java .util .UUID ;
233234import java .util .concurrent .CompletableFuture ;
235+ import java .util .concurrent .CompletionException ;
234236import java .util .concurrent .ConcurrentLinkedQueue ;
235237import java .util .concurrent .ScheduledFuture ;
236238import java .util .concurrent .TimeUnit ;
@@ -877,7 +879,14 @@ public boolean onMicrosoftLoginComplete(PendingMicrosoftAuthentication.Authentic
877879 return task .getAuthentication ().handle ((result , ex ) -> {
878880 if (ex != null ) {
879881 geyser .getLogger ().error ("Failed to log in with Microsoft code!" , ex );
880- disconnect (ex .toString ());
882+ if (ex instanceof CompletionException ce
883+ && ce .getCause () instanceof MinecraftRequestException mre
884+ && mre .getResponse ().getStatusCode () == 404 ) {
885+ // Player is trying to join with a Microsoft account that doesn't have Java Edition purchased
886+ disconnect (GeyserLocale .getPlayerLocaleString ("geyser.network.remote.invalid_account" , locale ()));
887+ } else {
888+ disconnect (ex .toString ());
889+ }
881890 return false ;
882891 }
883892
You can’t perform that action at this time.
0 commit comments