Open DylanWake opened 3 years ago
the class for launchTesting.java //i did a little modification to allow login with mojang accounts
/**
* Based on GradleStart from ForgeGradle 2.3
*
* @author Brady
* @since 3/11/2019
*/
public class LaunchTesting {
public static void main(String[] args) {
Map<String, String> arguments = new HashMap<>();
hackNatives();
arguments.put("version", "1.16");
arguments.put("assetIndex", System.getenv("assetIndex"));
arguments.put("assetsDir", System.getenv().getOrDefault("assetDirectory", "assets"));
arguments.put("accessToken", "FML");
arguments.put("userProperties", "{}");
arguments.put("tweakClass", System.getenv("tweakClass"));
attemptLogin(arguments, "<username>", "<password>");
//arguments.put("username","KJBot");
List<String> argsArray = new ArrayList<>();
System.out.println("----------- LaunchInfo -----------");
arguments.forEach((k, v) -> {
System.out.printf("%s :: %s \n",k,v);
argsArray.add("--" + k);
argsArray.add(v);
});
System.out.println("----------------------------------");
Launch.main(argsArray.toArray(new String[0]));
}
private static void hackNatives() {
String paths = System.getProperty("java.library.path");
String nativesDir = System.getenv().get("nativesDirectory");
if (Strings.isNullOrEmpty(paths))
paths = nativesDir;
else
paths += File.pathSeparator + nativesDir;
System.setProperty("java.library.path", paths);
// hack the classloader now.
try {
final Field sysPathsField = ClassLoader.class.getDeclaredField("sys_paths");
sysPathsField.setAccessible(true);
sysPathsField.set(null, null);
} catch (Throwable ignored) {}
}
private static void attemptLogin(Map<String, String> argMap, String username, String password) {
System.out.println("LOGGING IN: ----------------------------------");
YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) (new YggdrasilAuthenticationService(Proxy.NO_PROXY, "1")).createUserAuthentication(Agent.MINECRAFT);
auth.setUsername(username);
auth.setPassword(password);
try {
auth.logIn();
} catch (AuthenticationException var4) {
var4.printStackTrace();
throw new RuntimeException(var4);
}
argMap.put("accessToken", auth.getAuthenticatedToken());
argMap.put("uuid", auth.getSelectedProfile().getId().toString().replace("-", ""));
argMap.put("username", auth.getSelectedProfile().getName());
argMap.put("userType", auth.getUserType().getName());
argMap.put("userProperties", (new GsonBuilder()).registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()).create().toJson(auth.getUserProperties()));
}
}
Does it work whilst using a non modified launchTesting.java?
No actually I am now experiencing this @l1ving have sponge changed their repos again?
Yes since I have sponge not working and I manually updated the link in the maven of build.gradle
My version:
epositories {
mavenCentral()
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/maven/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
}
it did correctly downloaded needed dependencies, but since then I have the exception described
no, I also tried the default LaunchTesting.java
, and even cloning and rebuilding the project do no help
Log for 1.16.4 project :runClient
I just build without any modifications in code or gradle settings :
[11:55:14] [main/ERROR]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.baritone.json:MixinWorldRenderer, name: baritone.launch.mixins.MixinWorldRenderer
[11:55:14] [main/WARN]: Error loading class: me/jellysquid/mods/sodium/client/world/SodiumChunkManager (java.lang.ClassNotFoundException: The specified class 'me.jellysquid.mods.sodium.client.world.SodiumChunkManager' was not found)
[11:55:14] [main/WARN]: Error loading class: me/jellysquid/mods/sodium/client/util/collections/FixedLongHashTable (java.lang.ClassNotFoundException: The specified class 'me.jellysquid.mods.sodium.client.util.collections.FixedLongHashTable' was not found)
[11:55:14] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[11:55:19] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[11:55:22] [Render thread/ERROR]: Failed to verify authentication
com.mojang.authlib.exceptions.AuthenticationUnavailableException
at com.mojang.authlib.yggdrasil.YggdrasilSocialInteractionsService.checkPrivileges(YggdrasilSocialInteractionsService.java:97) ~[YggdrasilSocialInteractionsService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilSocialInteractionsService.<init>(YggdrasilSocialInteractionsService.java:40) ~[YggdrasilSocialInteractionsService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createSocialInteractionsService(YggdrasilAuthenticationService.java:152) ~[YggdrasilAuthenticationService.class:?]
at net.minecraft.client.Minecraft.func_244735_a(Minecraft.java:552) [Minecraft.class:?]
at net.minecraft.client.Minecraft.<init>(Minecraft.java:387) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:149) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at baritone.launch.LaunchTesting.main(LaunchTesting.java:66) [launch/:?]
---- Minecraft Crash Report ----
// Why did you do that?
Time: 2/12/21 11:55 AM
Description: Initializing game
java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.info(Ljava/lang/String;Ljava/lang/Object;)V
at net.minecraft.client.Minecraft.<init>(Minecraft.java:389)
at net.minecraft.client.main.Main.main(Main.java:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at baritone.launch.LaunchTesting.main(LaunchTesting.java:66)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
I also get this error. Did you find out how to fix it?
When I searched for the error I found that it seems to be some versions of log4j not behaving how they should and tried adding a random log4j version by adding runtime launchCompile('org.apache.logging.log4j:log4j-core:2.8')
to the dependencies in the buildscript, which apparently made it work.
Tested on 1.13.2, 1.14.4, 1.15.2 and 1.16.5
Some information
Operating system: Windows 10 Java version: 15 Minecraft version: Intellij Idea Development Environment 1.15.2 , 1.16.1, 1.16.4 Baritone version: 1.6.1 Forge mods (if used):
Issue description
I've encountered the same exception on all three versions of minecraft, emerges after gradle automatically updated dependencies from
repo.spongepowered.org
before launching the game, it seems likeorg.apache.logging.log4j.Logger
is missing or modified. ( though i see it get downloaded when executing task :BuildNeeded )Exception, error or logs
How to reproduce
1: Build the project with build.gradle 2: build : "buildDependencies" & "buildNeeded" 3: build : “run client”
Final checklist