aboutsummaryrefslogtreecommitdiff
path: root/fabric/src/main/java/de/hype
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-10-17 16:23:12 +0200
committerhackthetime <l4bg0jb7@duck.com>2023-10-17 16:23:12 +0200
commit12b944de4e1b69eaf5ffc0627191f984d94a2f40 (patch)
tree80ea8a6d53a043c1e4f96aa96ae566a56a147494 /fabric/src/main/java/de/hype
parent70dbcacd50bbde0829958599ac0454610a874214 (diff)
downloadBBsentials-12b944de4e1b69eaf5ffc0627191f984d94a2f40.tar.gz
BBsentials-12b944de4e1b69eaf5ffc0627191f984d94a2f40.tar.bz2
BBsentials-12b944de4e1b69eaf5ffc0627191f984d94a2f40.zip
things related mojang auth fixes
Diffstat (limited to 'fabric/src/main/java/de/hype')
-rw-r--r--fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java
index d3a8ae3..ce2c0bb 100644
--- a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java
+++ b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java
@@ -10,8 +10,6 @@ import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import java.io.File;
-import java.math.BigInteger;
-import java.util.Random;
public class MCUtils implements de.hype.bbsentials.common.mclibraries.MCUtils {
public boolean isWindowFocused() {
@@ -48,10 +46,16 @@ public class MCUtils implements de.hype.bbsentials.common.mclibraries.MCUtils {
}
public String mojangAuth(String serverId) {
- try {
- MinecraftClient.getInstance().getSessionService().joinServer(MinecraftClient.getInstance().getGameProfile().getId(), MinecraftClient.getInstance().getSession().getAccessToken(), serverId);
- } catch (AuthenticationException ignored) {
- return "";
+ boolean success = false;
+ int tries = 10;
+ while (tries > 0 && !success) {
+ tries--;
+ try {
+ MinecraftClient.getInstance().getSessionService().joinServer(MinecraftClient.getInstance().getGameProfile().getId(), MinecraftClient.getInstance().getSession().getAccessToken(), serverId);
+ success = true;
+ } catch (AuthenticationException ignored) {
+
+ }
}
return serverId;
}