FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
238 stars 203 forks source link

1.16.5 dev workspace is microsoft account-banned from multiplayer #915

Open quat1024 opened 1 year ago

quat1024 commented 1 year ago

Not sure if this is on floader or loom, guessing loom

./gradlew --version ``` ------------------------------------------------------------ Gradle 7.6.1 ------------------------------------------------------------ Build time: 2023-02-24 13:54:42 UTC Revision: 3905fe8ac072bbd925c70ddbddddf4463341f4b4 Kotlin: 1.7.10 Groovy: 3.0.13 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.5 (Eclipse Adoptium 17.0.5+8) OS: Windows 10 10.0 amd64 ```
build.gradle (just a minimal 1.16.5 setup with loom 1.1.14 and latest floader) ```gradle buildscript { repositories { mavenCentral() maven { url "https://maven.fabricmc.net/" } } dependencies { classpath "fabric-loom:fabric-loom.gradle.plugin:1.1.14" } } apply plugin: "fabric-loom" dependencies { minecraft "com.mojang:minecraft:1.16.5" mappings loom.officialMojangMappings() modImplementation "net.fabricmc:fabric-loader:0.14.21" } ```
gradle.properties (trivial) ``` org.gradle.jvmargs=-Xmx4G ```

./gradlew runClient results in this on the main menu:

image

modmuss50 commented 1 year ago

This was caused by a change made to Mojang's authentication servers, and happens in vanilla/any other mod loader. When not authenicated the endpoint now returns a valid json, the version of auth lib used in 1.16.5 does not handle/check the http status code, leading to this.

I really would like to find a good way to fix this, however I have my reservations about changing authenication related code.

A temporary work around is to set the authenication URLs to a domain that does not exist, this can be done with the following JVM args:

-Dminecraft.api.auth.host=https://nope.invalid
-Dminecraft.api.account.host=https://nope.invalid
-Dminecraft.api.session.host=https://nope.invalid
-Dminecraft.api.services.host=https://nope.invalid

This is not something we can apply by default as it will break anyone who actually wants to authenicate in dev (using a 3rd party mod/gradle plugin).

Another possible solution that I have not tried yet is updating AuthLib to a newer version that correctly handles the http status code, in the same way newer versions do. I think we would struggle to get this fixed on Mojang's end due to a range of reasons.

For reference here is the discussion I had on Discord about this: https://discord.com/channels/507304429255393322/566418023372816394/1118559190466691212

quat1024 commented 1 year ago

Oh wow, sorry, i feel really silly for not checking this in vanilla 🌝

modmuss50 commented 1 year ago

Just to be clear it happens in vanilla when you are not authenticated, running it via the normal launcher when logged in will work as expected 👍