[CUSTOM CODE] ClassDefNotFoundError

Started by znaxcy on

Topic category: Advanced modding

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[CUSTOM CODE] ClassDefNotFoundError

Here's the one custom code procedure I have in the mod (the files for which I have rebuilt before producing this error again), which utilizes an apparently working API from SereneSeasons mod:

package net.mcreator.viticulture;

import net.minecraft.world.World;

import java.util.HashMap;

import sereneseasons.api.season.ISeasonState;
import sereneseasons.api.season.SeasonHelper;
import sereneseasons.api.season.Season;
import sereneseasons.api.season.Season.SubSeason;

@Elementsviticulture.ModElement.Tag
public class MCreatorProcedureCheckSeason extends Elementsviticulture.ModElement {
	public MCreatorProcedureCheckSeason(Elementsviticulture instance) {
		super(instance, 80);
	}

	public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
		double LocalCurrentSeason = 0;
		LocalCurrentSeason = (double) 0;
		World world = (World) dependencies.get("world");

	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.EARLY_SPRING) {
		LocalCurrentSeason = 1;
		System.out.println(LocalCurrentSeason);
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.MID_SPRING) {
		LocalCurrentSeason = 2;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.LATE_SPRING) {
		LocalCurrentSeason = 3;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.EARLY_SUMMER) {
		LocalCurrentSeason = 4;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.MID_SUMMER) {
		LocalCurrentSeason = 5;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.LATE_SUMMER) {
		LocalCurrentSeason = 6;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.EARLY_AUTUMN) {
		LocalCurrentSeason = 7;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.MID_AUTUMN) {
		LocalCurrentSeason = 8;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.LATE_AUTUMN) {
		LocalCurrentSeason = 9;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.EARLY_WINTER) {
		LocalCurrentSeason = 10;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.MID_WINTER) {
		LocalCurrentSeason = 11;
	}
	if (SeasonHelper.getSeasonState(world).getSubSeason() == Season.SubSeason.LATE_WINTER) {	
		LocalCurrentSeason = 12;
	}
    
	viticultureVariables.WorldVariables.get(world).GlobalCurrentSeason = (double) (LocalCurrentSeason);
	viticultureVariables.WorldVariables.get(world).markDirty();
	}
}

 

When I run, the console gives me this:

   
Executing gradle task: runClient
Build info: MCreator 2019.5.51710, 1.12.2, 64-bit, 16384 MB, Mac OS X, JVM 1.8.0_222, JAVA_HOME: /Applications/MCreator.app/Contents/MacOS/jdk/Contents/Home/jre
This mapping 'snapshot_20171003' was designed for MC 1.12! Use at your own peril.
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava UP-TO-DATE
:compileApiJava NO-SOURCE
:processApiResources NO-SOURCE
:apiClasses UP-TO-DATE
:sourceMainJava UP-TO-DATE
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:getVersionJson
:extractNatives SKIPPED
:extractUserdev UP-TO-DATE
:getAssetIndex UP-TO-DATE
:getAssets
Current status: 215/1305   16%
Current status: 1060/1305   81%
Current status: 1064/1305   81%
Current status: 1067/1305   81%
Current status: 1070/1305   81%
Current status: 1076/1305   82%
Current status: 1139/1305   87%
Current status: 1149/1305   88%
:makeStart SKIPPED
:runClient
10:31.05 [main/INFO] [GradleStart]: Extra: []
10:31.05 [main/INFO] [GradleStart]: Found and added coremod: sereneseasons.asm.SSLoadingPlugin
10:31.05 [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /Users/username/.mcreator/gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
10:31.06 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
10:31.06 [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
10:31.06 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
10:31.06 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
10:31.06 [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading
10:31.06 [main/INFO] [FML]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_222, running on Mac OS X:x86_64:10.13.6, installed at /Applications/MCreator.app/Contents/MacOS/jdk/Contents/Home/jre
10:31.06 [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
10:31.06 [main/ERROR] [FML]: Full: /Users/username/.mcreator/gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4/maven-artifact-3.5.3.jar
10:31.06 [main/ERROR] [FML]: Trimmed: /users/username/.mcreator/gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
10:31.06 [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
10:31.06 [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
2019-12-25 10:31:08,483 main WARN Disabling terminal, you're running in an unsupported environment.
10:31.08 [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
10:31.08 [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
10:31.08 [main/INFO] [FML]: Found a command line coremod : sereneseasons.asm.SSLoadingPlugin
10:31.08 [main/WARN] [FML]: The coremod sereneseasons.asm.SSLoadingPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft
10:31.08 [main/INFO] [FML]: Ignoring missing certificate for coremod SSLoadingPlugin (sereneseasons.asm.SSLoadingPlugin), as this is probably a dev workspace
10:31.08 [main/INFO] [FML]: Searching /Users/username/MCreatorWorkspaces/viticulture/run/./mods for mods
10:31.08 [main/WARN] [FML]: Found FMLCorePluginContainsFMLMod marker in SereneSeasons-1.12.2-1.2.18-universal.jar. This is not recommended, @Mods should be in a separate jar from the coremod.
10:31.08 [main/WARN] [FML]: The coremod sereneseasons.asm.SSLoadingPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft
10:31.08 [main/WARN] [FML]: The coremod SSLoadingPlugin (sereneseasons.asm.SSLoadingPlugin) is not signed!
10:31.08 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
10:31.08 [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
10:31.08 [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
10:31.08 [main/INFO] [GradleStart]: Injecting location in coremod sereneseasons.asm.SSLoadingPlugin
10:31.08 [main/INFO] [GradleStart]: Injecting location in coremod sereneseasons.asm.SSLoadingPlugin
10:31.08 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
10:31.08 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
10:31.08 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
10:31.08 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
10:31.08 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
10:31.08 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
10:31.11 [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
10:31.11 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
10:31.11 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
10:31.12 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
10:31.12 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
10:31.13 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
10:31.14 [main/INFO] [GradleStart]: Remapping AccessTransformer rules...
10:31.14 [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
10:31.14 [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
10:31.14 [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
10:31.14 [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.reflect.InvocationTargetException: null
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
) ~[?:1.8.0_222]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43
) ~[?:1.8.0_222]
   at java.lang.reflect.Method.invoke(Method.java:498
) ~[?:1.8.0_222]
   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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
) ~[?:1.8.0_222]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43
) ~[?:1.8.0_222]
   at java.lang.reflect.Method.invoke(Method.java:498
) ~[?:1.8.0_222]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97
) [start/:?]
   at GradleStart.main(<a href="file:GradleStart.main(GradleStart.java:25) [start/:?]
.GradleStart:25" style="background-color: rgb(30, 30, 30)">GradleStart.java:25
) [start/:?]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/world/World
   at net.minecraft.client.main.Main.main(Main.java:42
) ~[Main.class:?]
   ... 12 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.World
   at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191
) ~[launchwrapper-1.12.jar:?]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424
) ~[?:1.8.0_222]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357
) ~[?:1.8.0_222]
   at net.minecraft.client.main.Main.main(Main.java:42
) ~[Main.class:?]
   ... 12 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer sereneseasons.asm.transformer.WorldTransformer@4eb45fec from coremod SSLoadingPlugin
   at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260
) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
   at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279
) ~[launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176
) ~[launchwrapper-1.12.jar:?]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424
) ~[?:1.8.0_222]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357
) ~[?:1.8.0_222]
   at net.minecraft.client.main.Main.main(Main.java:42
) ~[Main.class:?]
   ... 12 more
Caused by: java.lang.RuntimeException: No method instruction node found matching net/minecraft/world/World getBiome (Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/world/biome/Biome;
   at sereneseasons.asm.ASMHelper.getUniqueMethodInsnNode(ASMHelper.java:75
) ~[SereneSeasons-1.12.2-1.2.18-universal.jar:?]
   at sereneseasons.asm.transformer.WorldTransformer.transformWorld(WorldTransformer.java:121
) ~[SereneSeasons-1.12.2-1.2.18-universal.jar:?]
   at sereneseasons.asm.transformer.WorldTransformer.transform(WorldTransformer.java:41
) ~[SereneSeasons-1.12.2-1.2.18-universal.jar:?]
   at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256
) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
   at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279
) ~[launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176
) ~[launchwrapper-1.12.jar:?]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424
) ~[?:1.8.0_222]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357
) ~[?:1.8.0_222]
   at net.minecraft.client.main.Main.main(Main.java:42
) ~[Main.class:?]
   ... 12 more
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052 java.lang.reflect.InvocationTargetException
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at java.lang.reflect.Method.invoke(Method.java:498
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052    at GradleStart.main(<a href="file:GradleStart.main(GradleStart.java:25)
.GradleStart:25" style="background-color: rgb(30, 30, 30)">GradleStart.java:25
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061 Caused by: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:49
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at java.lang.SecurityManager.checkExit(SecurityManager.java:761
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at java.lang.Runtime.exit(Runtime.java:107
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at java.lang.System.exit(System.java:971
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at net.minecraft.launchwrapper.Launch.launch(Launch.java:138
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    at net.minecraft.launchwrapper.Launch.main(Launch.java:28
)
10:31.15 [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061    ... 6 more
:runClient FAILED
Exception in thread "main" 
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runClient'.
> Process 'command '/Applications/MCreator.app/Contents/MacOS/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 26s
12 actionable tasks: 5 executed, 7 up-to-date
BUILD FAILED
Task completed in 26454 milliseconds

Appears to be an issue with net.minecraft.world.world but I don't know nearly enough about what I'm doing to figure out how to fix it.

Thanks in advance for help figuring this out!

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you. Would you mind…
Thu, 12/26/2019 - 16:29

Thank you. Would you mind briefly explaining how you found this? Thanks

java.lang.reflect…
Thu, 12/26/2019 - 18:57

java.lang.reflect.InvocationTargetException: null    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62 ) ~[?:1.8.0_222]

Seems that API is using reflection and the class it is looking for is nor present.