Skip to content

Commit

Permalink
Readd old dependency to maintain authlib login support
Browse files Browse the repository at this point in the history
  • Loading branch information
Shanwer committed Jul 27, 2024
1 parent bb96ba6 commit 78aa9af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bootstrap/mod/fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
shadow(libs.protocol.connection) { isTransitive = false }
shadow(libs.protocol.common) { isTransitive = false }
shadow(libs.protocol.codec) { isTransitive = false }
shadow(libs.mcauthlib) { isTransitive = false }
shadow(libs.minecraftauth) { isTransitive = false }
shadow(libs.raknet) { isTransitive = false }

Expand Down Expand Up @@ -67,4 +68,4 @@ modrinth {
dependencies {
required.project("fabric-api")
}
}
}
3 changes: 3 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ dependencies {

api(libs.bundles.protocol)

api(libs.mcauthlib)
api(libs.minecraftauth)
api(libs.mcprotocollib) {
exclude("io.netty", "netty-all")
exclude("net.raphimc", "MinecraftAuth")
exclude("com.github.GeyserMC", "packetlib")
exclude("com.github.GeyserMC", "mcauthlib")
}

implementation(libs.raknet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.github.steveice10.mc.auth.data.GameProfile;
//import com.github.steveice10.mc.auth.data.GameProfile;
import com.github.steveice10.mc.auth.exception.request.InvalidCredentialsException;
import com.github.steveice10.mc.auth.exception.request.RequestException;
import com.github.steveice10.mc.auth.service.AuthenticationService;
import com.github.steveice10.mc.auth.service.MojangAuthenticationService;
import com.github.steveice10.mc.auth.service.MsaAuthenticationService;
import io.netty.channel.Channel;
import io.netty.channel.EventLoop;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
Expand Down Expand Up @@ -778,13 +777,13 @@ public void authenticate(String username,String password){
authenticationService.setUsername(username);
authenticationService.setPassword(password);
authenticationService.login();
GameProfile profile = authenticationService.getSelectedProfile();
com.github.steveice10.mc.auth.data.GameProfile profile = authenticationService.getSelectedProfile();
if (profile == null) {
// Java account is offline
disconnect(GeyserLocale.getPlayerLocaleString("geyser.network.remote.invalid_account", clientData.getLanguageCode()));
return null;
}
protocol = new MinecraftProtocol(profile, authenticationService.getAccessToken());
protocol = new MinecraftProtocol(new GameProfile(profile.getId(), profile.getName()), authenticationService.getAccessToken());
}
}catch (InvalidCredentialsException | IllegalArgumentException e) {
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.auth.login.invalid", username));
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gson = "2.3.1" # Provided by Spigot 1.8.8
websocket = "1.5.1"
protocol = "3.0.0.Beta2-20240704.153116-14"
raknet = "1.0.0.CR3-20240416.144209-1"
mcauthlib = "e5b0bcc"
minecraftauth = "4.1.0"
mcprotocollib = "1.21-20240725.013034-16"
adventure = "4.14.0"
Expand Down Expand Up @@ -107,6 +108,7 @@ commodore = { group = "me.lucko", name = "commodore", version.ref = "commodore"
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
junit = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
mcauthlib = { group = "com.github.GeyserMC", name = "MCAuthLib", version.ref = "mcauthlib" }
minecraftauth = { group = "net.raphimc", name = "MinecraftAuth", version.ref = "minecraftauth" }
mcprotocollib = { group = "org.geysermc.mcprotocollib", name = "protocol", version.ref = "mcprotocollib" }
raknet = { group = "org.cloudburstmc.netty", name = "netty-transport-raknet", version.ref = "raknet" }
Expand Down

0 comments on commit 78aa9af

Please sign in to comment.