0
votes

I'm able to run a server with the Pixelmon mod in the way they instruct, ie. using the forge launcher. I'd like to write a side mod for Pixelmon and am attempting to run the forge server in Eclipse. The server and client run fine with my own mod or no additional mods aside from the ones packaged for modding with forge, but it crashes when I put the pixelmon jar in the mods folder (see trace below).

What I've checked so far:

  • forge version 2705 is correct for Pixelmon 6.3.1
  • using Java 8
  • no .zip extension on the jar file
  • didn't extract the jar file
  • no OOM issues
  • Minecraft 1.12.2 is correct for Pixelmon 6.3.1

Any thoughts on what I may be doing wrong and can try next?

(from the crash log)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Mac OS X (x86_64) version 10.13.4
    Java Version: 1.8.0_101, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 774347184 bytes (738 MB) / 900726784 bytes (859 MB) up to 3817865216 bytes (3641 MB)
    JVM Flags: 0 total; 
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.4.2705 6 mods loaded, 6 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

| State | ID         | Version      | Source                              | Signature |
|:----- |:---------- |:------------ |:----------------------------------- |:--------- |
| UC    | minecraft  | 1.12.2       | minecraft.jar                       | None      |
| UC    | mcp        | 9.42         | minecraft.jar                       | None      |
| UC    | FML        | 8.0.99.99    | forgeSrc-1.12.2-14.23.4.2705.jar    | None      |
| UC    | forge      | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar    | None      |
| UC    | examplemod | 1.0          | main                                | None      |
| U     | pixelmon   | 6.3.1        | Pixelmon-1.12.2-6.3.1-universal.jar | None      |

Loaded coremods (and transformers): 
Profiler Position: N/A (disabled)
Is Modded: Definitely; Server brand changed to 'fml,forge'
Type: Dedicated Server (map_server.txt)

Trace here:

[10:39:42] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
java.lang.NoClassDefFoundError: com/pixelmonmod/pixelmon/config/PixelmonConfig
    at com.pixelmonmod.pixelmon.storage.PixelmonStorage.<clinit>(PixelmonStorage.java:26) ~[PixelmonStorage.class:?]
    at com.pixelmonmod.pixelmon.Pixelmon.<clinit>(Pixelmon.java:121) ~[Pixelmon.class:?]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_101]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_101]
    at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:530) ~[forgeSrc-1.12.2-14.23.4.2705.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) ~[forgeSrc-1.12.2-14.23.4.2705.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) ~[forgeSrc-1.12.2-14.23.4.2705.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:593) ~[Loader.class:?]
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:332) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.ClassNotFoundException: com.pixelmonmod.pixelmon.config.PixelmonConfig
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_101]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_101]
    ... 36 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: info.pixelmon.repack.ninja.leaping.configurate.objectmapping.ObjectMappingException
    at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1728) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1698) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.Frame.merge(Frame.java:1530) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.Frame.merge(Frame.java:1441) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1516) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(LocalVariablesSorter.java:165) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1634) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1032) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:708) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:521) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer.transform(DeobfuscationTransformer.java:51) ~[forgeSrc-1.12.2-14.23.4.2705.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_101]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_101]
    ... 36 more
1

1 Answers

2
votes

This is because mod jars are obfuscated

An aside about obfuscated names

Minecraft has 3 levels of naming:

  1. Notch Names - these are the names of methods and fields that Minecraft uses when distributed. Often things like a.aa and b.cf2. This is the fully obfuscated state
  2. SRG Names - these are the names given to methods and fields by the runtime deobfuscation process that Forge performs when you run the game. Compiled mods use these names, as they are consistent across minor versions
  3. MCP Names - these are the human readable names you see inside Eclipse. These names are supplied by hand when someone figures out what a field or method does via the MCP Bot on IRC. Installing the Forge development environment with the MDK grabs the "current" mappings when you run gradlew setup

In order to run a mod in the development environment you need to deobfuscate it first, changing SRG names into MCP names, so that it can run in the development environment.

There are a couple ways of doing this:

  1. Acquire a "sources" jar from the mod's author (subject to the whims of the author; may or may not be public or open source, have an API, etc. etc.)
  2. Use Code Chicken Core to perform a runtime deobf in Eclipse (may or may not work; note: you want the sources jar)
  3. Using a tool like BON2 (never used it, should work)
  4. use Gradle to deobfuscate the mod (should always work)

The problem with option 4 here, is that while I know it's possible I can't (and haven't been able to for some time) find the necessary instructions. The things I can find now, posted by people who would know how to do 4 are suggesting doing 3.