Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Semx11

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Semx11's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. In what class can I find the 'true runtime value'? I'm not sure where to look, and I can use reflection. EDIT: I found the GuiOverlayDebug.class in net.minecraft.client.gui , and it looks like such: This means that in the Minecraft version, the version is hardcoded. This should not be a problem, as I can use Reflection to call this protected call() method. Is this the right way to do it, or might there be an easier way? Thanks in advance. EDIT 2: I don't have any experience with creating core-mods, so how can I find out what the call() method gets mapped to? Any tutorial?
  2. Hello, I am using analytics for a mod of mine, and I need to get launched Minecraft version (e.g. "1.8", "1.10.2"). When using Minecraft.getMinecraft().getVersion() , it returns (in the case of Forge) for example 1.10.2-forge1.10.2-[forge_version] . This is useful, as I can extract the version number out of this using Regex or equivalent. However, there are modloaders, such as MultiMC5. When playing Minecraft via MultiMC5, it sets the Minecraft version to "MultiMC5", and you can't extract data out of that. There is another way, and that is using either MinecraftForge.MC_VERSION or Loader.MC_VERSION (they are the same thing). But here is the problem, this variable is not present at the FMLInitializationEvent That variable is present, but incorrect. Read "EDIT 2", and I need this variable to be set/accessible when it is initializing. Due to other reasons, (EDIT 2) the detection has to be done before messages can be send to the player. Is there another way to get the launched Minecraft version? Or is there another event that happens between the initialization and the player joining a server/world? I tried to use FMLPostInitializationEvent, but that crashed the entire client for some reason. Read "EDIT 2". Thanks in advance, Semx EDIT This also happens when I am in-game: EDIT 2 Might as well add the (most likely) reason why this happens: I am trying to make a universal mod, so one that supports 1.8 to 1.10.2. Some classes and functions change with the Minecraft Forge version, but I got that covered using reflection. When it fails to detect what version it is, it breaks down. EDIT 3 I am positive that there is a way to get the Minecraft version. Even the debug menu has it right: Keep in mind that this is the same version/instance as the screenshot above.
  3. Bump? It's the only issue I have left, and it appears using ForgeGradle.
  4. After being in contact with some people on the #ForgeGradle IRC, my build.gradle now looks like this (and runs fine): buildscript { repositories { jcenter() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' } } plugins { id 'com.github.johnrengelman.shadow' version '1.2.3' } apply plugin: 'net.minecraftforge.gradle.forge' version = "1.3" group = "me.semx11.[secret]" archivesBaseName = "[secret]" sourceCompatibility = '1.8' targetCompatibility = '1.8' minecraft { version = "1.8.9-11.15.1.1722" runDir = "run" mappings = "stable_20" } shadowJar { relocate 'com.jayway.jsonpath', 'me.semx11.[secret].repack.com.jayway.jsonpath' } reobf { shadowJar { mappingType = 'SEARGE' } } tasks.build.dependsOn reobfShadowJar dependencies { compile 'com.jayway.jsonpath:json-path:2.2.0' } processResources { inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' expand 'version': project.version, 'mcversion': project.minecraft.version } from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } idea { module.inheritOutputDirs = true } When using "gradlew.bat clean build" , it builds the shaded jar. When launching Minecraft, it still produces the following error: Time: 2-7-16 12:49 Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:162) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:739) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:310) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:495) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) at net.minecraft.client.main.Main.main(SourceFile:124) 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:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.jayway.jsonpath.internal.JsonContext.<clinit>(JsonContext.java:46) at com.jayway.jsonpath.JsonPath.parse(JsonPath.java:596) at me.semx11.[secret].Main.[secret](Main.java:142) at me.semx11.[secret].Main.init(Main.java:67) 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:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560) 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:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189) 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:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:737) ... 10 more Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 41 more I have read on Stackoverflow that I need several slf4j .jars. I have tried all the combinations that were suggested on StackOverflow, but none of them worked. When adding "compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'" to my build.gradle in the dependencies block, it strangely enough does not increase the .jar size, nor changes anything regarding the stacktrace error that is thrown. How do you correctly add SLF4J to your build.gradle?
  5. I have added the JsonPath library for Java (https://github.com/jayway/JsonPath) to my ForgeGradle project. Following the ForgeGradle wiki on Github, I have added this library to my build.gradle, which looks like this: configurations { embed compile.extendsFrom(embed) } dependencies { embed 'com.jayway.jsonpath:json-path:2.2.0' } jar { from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } } This works fine in IntelliJ when using the "Run: Minecraft Client" (or "Debug: Minecraft Client") option. When running "gradlew.bat build" in the terminal, it prints out the following stacktrace: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':reobfJar'. > java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':reobfJar'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:155) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:152) at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:94) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:94) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: org.gradle.api.UncheckedIOException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:43) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 60 more Caused by: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class at net.minecraftforge.gradle.user.TaskSingleReobf.applyExtraTransformers(TaskSingleReobf.java:253) at net.minecraftforge.gradle.user.TaskSingleReobf.doTask(TaskSingleReobf.java:184) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) ... 67 more BUILD FAILED I solved this particular error by changing the following in my build.gradle: dependencies { embed ('com.jayway.jsonpath:json-path:2.2.0') { transitive = true exclude module: 'asm' } } This solution (that I found on Google/Stackoverflow) worked to a certain extent. My build ran succesfully, but when trying to launch Minecraft it gives the following error: Time: 2-7-16 12:49 Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:162) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:739) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:310) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:495) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) at net.minecraft.client.main.Main.main(SourceFile:124) 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:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.jayway.jsonpath.internal.JsonContext.<clinit>(JsonContext.java:46) at com.jayway.jsonpath.JsonPath.parse(JsonPath.java:596) at me.semx11.[secret].Main.[secret](Main.java:142) at me.semx11.[secret].Main.init(Main.java:67) 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:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560) 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:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189) 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:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:737) ... 10 more Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 41 more The stacktrace says that it can't find org\slf4j\LoggerFactory.class, but when I look in my .jar: I have tried everything, even manually downloading all the extra libraries that JsonPath seems to need, but with no luck. I am out of options, so that's why I am here, hoping somebody knows how to add it. The thing that confuses me the most is that it works fine when running it in IntelliJ. If you need any additional information about my project settings, or anything really, please let me know, and I will post it. Thank you in regards, Semx11
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.