Yeeting Libs
Dieser Commit ist enthalten in:
Ursprung
96e4d46eb5
Commit
6832e762d4
@ -31,10 +31,6 @@ dependencies {
|
|||||||
}
|
}
|
||||||
modCompileOnlyApi "com.terraformersmc:modmenu:4.0.6"
|
modCompileOnlyApi "com.terraformersmc:modmenu:4.0.6"
|
||||||
compileOnly project(":common")
|
compileOnly project(":common")
|
||||||
|
|
||||||
// Used to Override 'private final'
|
|
||||||
compileOnly 'org.jooq:joor:0.9.14'
|
|
||||||
include 'org.jooq:joor:0.9.14'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
package de.chaoscaot.altauth.fabric.mixin;
|
package de.chaoscaot.altauth.fabric.mixin;
|
||||||
|
|
||||||
import com.mojang.authlib.yggdrasil.YggdrasilEnvironment;
|
import com.mojang.authlib.yggdrasil.YggdrasilEnvironment;
|
||||||
|
import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
|
||||||
import de.chaoscaot.altauth.fabric.AltAuth;
|
import de.chaoscaot.altauth.fabric.AltAuth;
|
||||||
import de.chaoscaot.altauth.fabric.TrustServerScreen;
|
import de.chaoscaot.altauth.fabric.TrustServerScreen;
|
||||||
import de.chaoscaot.altauth.fabric.config.ClientConfig;
|
import de.chaoscaot.altauth.fabric.config.ClientConfig;
|
||||||
|
import de.lixfel.ReflectionUtil;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
@ -14,7 +16,6 @@ import net.minecraft.client.gui.screen.DisconnectedScreen;
|
|||||||
import net.minecraft.client.network.ClientLoginNetworkHandler;
|
import net.minecraft.client.network.ClientLoginNetworkHandler;
|
||||||
import net.minecraft.network.packet.s2c.login.LoginHelloS2CPacket;
|
import net.minecraft.network.packet.s2c.login.LoginHelloS2CPacket;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import org.joor.Reflect;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@ -44,7 +45,7 @@ public class LoginRequestMixin {
|
|||||||
cs.status = Text.translatable("gui.altauth.connecting", server);
|
cs.status = Text.translatable("gui.altauth.connecting", server);
|
||||||
}
|
}
|
||||||
URL url = new URL("https://" + server + "/session/minecraft/join");
|
URL url = new URL("https://" + server + "/session/minecraft/join");
|
||||||
Reflect.on(MinecraftClient.getInstance().getSessionService()).set("joinUrl", url);
|
ReflectionUtil.getField(YggdrasilMinecraftSessionService.class, URL.class, 0).set(MinecraftClient.getInstance().getSessionService(), url);
|
||||||
} else {
|
} else {
|
||||||
if(MinecraftClient.getInstance().currentScreen instanceof ConnectScreen cs) {
|
if(MinecraftClient.getInstance().currentScreen instanceof ConnectScreen cs) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
@ -59,7 +60,7 @@ public class LoginRequestMixin {
|
|||||||
} else {
|
} else {
|
||||||
LOGGER.info("AltauthClient: LoginRequestMixin: Server is running on mojang");
|
LOGGER.info("AltauthClient: LoginRequestMixin: Server is running on mojang");
|
||||||
URL url = new URL(YggdrasilEnvironment.PROD.getEnvironment().getSessionHost() + "/session/minecraft/join");
|
URL url = new URL(YggdrasilEnvironment.PROD.getEnvironment().getSessionHost() + "/session/minecraft/join");
|
||||||
Reflect.on(MinecraftClient.getInstance().getSessionService()).set("joinUrl", url);
|
ReflectionUtil.getField(YggdrasilMinecraftSessionService.class, URL.class, 0).set(MinecraftClient.getInstance().getSessionService(), url);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -2,18 +2,20 @@
|
|||||||
|
|
||||||
package de.chaoscaot.altauth.fabric.mixin;
|
package de.chaoscaot.altauth.fabric.mixin;
|
||||||
|
|
||||||
|
import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
|
||||||
import com.mojang.datafixers.DataFixer;
|
import com.mojang.datafixers.DataFixer;
|
||||||
import de.chaoscaot.altauth.fabric.AltAuth;
|
import de.chaoscaot.altauth.fabric.AltAuth;
|
||||||
import de.chaoscaot.altauth.fabric.config.ServerConfig;
|
import de.chaoscaot.altauth.fabric.config.ServerConfig;
|
||||||
|
import de.lixfel.ReflectionUtil;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.resource.ResourcePackManager;
|
import net.minecraft.resource.ResourcePackManager;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.SaveLoader;
|
import net.minecraft.server.SaveLoader;
|
||||||
import net.minecraft.server.WorldGenerationProgressListenerFactory;
|
import net.minecraft.server.WorldGenerationProgressListenerFactory;
|
||||||
import net.minecraft.util.ApiServices;
|
import net.minecraft.util.ApiServices;
|
||||||
import net.minecraft.world.level.storage.LevelStorage;
|
import net.minecraft.world.level.storage.LevelStorage;
|
||||||
import org.joor.Reflect;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@ -31,9 +33,7 @@ public class MinecraftServerMixin {
|
|||||||
private void apiServiceMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, ApiServices apiServices, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory, CallbackInfo ci) {
|
private void apiServiceMixin(Thread serverThread, LevelStorage.Session session, ResourcePackManager dataPackManager, SaveLoader saveLoader, Proxy proxy, DataFixer dataFixer, ApiServices apiServices, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory, CallbackInfo ci) {
|
||||||
try {
|
try {
|
||||||
URL url = new URL("https://" + ServerConfig.INSTANCE.serverUrl + "/session/minecraft/hasJoined");
|
URL url = new URL("https://" + ServerConfig.INSTANCE.serverUrl + "/session/minecraft/hasJoined");
|
||||||
Reflect.on(apiServices.sessionService()).set("checkUrl", url);
|
ReflectionUtil.getField(YggdrasilMinecraftSessionService.class, URL.class, 1).set(MinecraftClient.getInstance().getSessionService(), url);
|
||||||
URL joinUrl = new URL("https://" + ServerConfig.INSTANCE.serverUrl + "/session/minecraft/join");
|
|
||||||
Reflect.on(apiServices.sessionService()).set("joinUrl", joinUrl);
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
AltAuth.LOGGER.error("Malformed URL: {}", e.getMessage());
|
AltAuth.LOGGER.error("Malformed URL: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren