Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge Mod Loader #1

Closed
wants to merge 52 commits into from
Closed

Forge Mod Loader #1

wants to merge 52 commits into from

Conversation

deathcap
Copy link
Contributor

@deathcap deathcap commented Apr 5, 2015

Adds forge mod loader.

@ethsmith
Copy link

ethsmith commented Apr 6, 2015

Is this gonna be the new Cauldron? :P

@deathcap
Copy link
Contributor Author

deathcap commented Apr 6, 2015

@TekkitCommando 😉 well, this might not happen due to the inherent challenges in supporting Forge/FML in a non-Minecraft environment in any useful capacity (more details at https://forums.glowstone.net/t/any-way-to-run-forge-mods-on-glowstone/94). The current major problem though is the java.lang.ClassCircularityError exception in net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer (stack trace in deathcap/Glowstone#2) which prevents event subscriptions from being registered.

So I doubt this project will reach Cauldron's level of compatibility in Forge + Bukkit, but it does in some sense share a similar philosophy of aiming for the broadest possible API compatibility (basically, the way I see it the more API support the better)

@ethsmith
Copy link

ethsmith commented Apr 6, 2015

Yep I agree

@deathcap
Copy link
Contributor Author

deathcap commented Apr 7, 2015

Updated to rebase on master but still has the EventSubscriberTransformer issue (disabled), and other problems:

+ java -mx2G -jar target/glowstone++-1.8.3-SNAPSHOT.jar
2015-04-06 20:39:34,440 ERROR Error processing element Queue: CLASS_NOT_FOUND
2015-04-06 20:39:34,468 ERROR Unable to locate appender ServerGuiConsole for logger 
2015-04-06 20:39:34,469 ERROR Unable to locate appender ServerGuiConsole for logger net.minecraft
2015-04-06 20:39:34,469 ERROR Unable to locate appender ServerGuiConsole for logger com.mojang
[20:39:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker
[20:39:34] [main/INFO] [FML]: Forge Mod Loader version 8.0.71.1061 for Minecraft 1.8 loading
[20:39:34] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_72, running on Mac OS X:x86_64:10.10.2, installed at /Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home/jre
[20:39:34] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[20:39:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[20:39:34] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[20:39:34] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:39:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[20:39:34] [main/WARN] [FML]: =============================================================
[20:39:34] [main/WARN] [FML]: MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!
[20:39:34] [main/WARN] [FML]: Offendor: net/minecraft/server/MinecraftServer.initiateShutdown()V
[20:39:34] [main/WARN] [FML]: Use FMLCommonHandler.exitJava instead
[20:39:34] [main/WARN] [FML]: =============================================================
[20:39:34] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}
[20:39:34] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:50]: about to invoke FML beginServerLoading()
[20:39:34] [main/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[20:39:34] [main/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[20:39:34] [main/INFO] [FML]: Searching /Users/admin/minecraft/Glowstone++/mods for mods
[20:39:36] [main/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.buildModList(net.minecraftforge.fml.common.event.FMLLoadEvent)
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
[20:39:36] [main/INFO] [FML]: Processing ObjectHolder annotations
[20:39:36] [main/INFO] [FML]: Found 0 ObjectHolder annotations
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
[20:39:36] [main/INFO] [FML]: Applying holder lookups
[20:39:36] [main/INFO] [FML]: Holder lookups applied
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:52]: Finished loading
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
Apr 06, 2015 8:39:36 PM com.google.common.eventbus.EventBus$LoggingSubscriberExceptionHandler handleException
SEVERE: Could not dispatch event: net.minecraftforge.fml.common.LoadController@5f37fd4b to public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent)
[20:39:36] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:54]: Initialization completed
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:58]: Modification loaded: Minecraft Coder Pack 9.05
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:58]: Modification loaded: Forge Mod Loader 8.0.71.1061
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:58]: Modification loaded: Iron Chest 6.0.99.749
[20:39:36] [main/INFO] [STDOUT]: [net.minecraft.server.MinecraftServer:main2:58]: Modification loaded: Ore Control 0.3.0
20:39:37 [INFO] This server is running Glowstone++ version git-Glowstone-1.8-514-g06e1bc6 (Implementing API version 1.8.3-R0.1-SNAPSHOT)
20:39:37 [INFO] Recipes: 295 shaped, 63 shapeless, 24 furnace, 14 fuels.
20:39:37 [INFO] Preparing spawn for world...
20:39:37 [INFO] Preparing spawn for world: done
20:39:37 [INFO] Preparing spawn for world_nether...
20:39:38 [INFO] Preparing spawn for world_nether: done
20:39:38 [INFO] Preparing spawn for world_the_end...
20:39:38 [INFO] Preparing spawn for world_the_end: done
20:39:38 [INFO] Binding to address: 0.0.0.0/0.0.0.0:25565...
20:39:38 [INFO] Successfully bound to: /0:0:0:0:0:0:0:0:25565
20:39:38 [INFO] Ready for connections.

@deathcap
Copy link
Contributor Author

deathcap commented Apr 8, 2015

Found a fix for the ASM java.lang.ClassCircularityError exception in net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer with java.lang.NoClassDefFoundError: org/apache/commons/lang3/JavaVersion (deathcap/Glowstone#2) via https://github.com/SpongePowered/Sponge/blob/c3691746e9d1b5e86a73d124d8e3218cdc164670/src/main/java/org/spongepowered/mod/SpongeCoremod.java#L40

        // Transformer exclusions
        ((net.minecraft.launchwrapper.LaunchClassLoader) getClass().getClassLoader()).addTransformerExclusion("ninja.leaping.configurate");

if I edit FML to add this exclusion, then the event subscriber transform no longer crashes:

--- a/src/main/java/net/minecraftforge/fml/common/launcher/FMLServerTweaker.java
+++ b/src/main/java/net/minecraftforge/fml/common/launcher/FMLServerTweaker.java
@@ -20,6 +20,7 @@ public class FMLServerTweaker extends FMLTweaker {
         classLoader.addTransformerExclusion("net.minecraftforge.fml.relauncher.");
         classLoader.addTransformerExclusion("net.minecraftforge.fml.common.asm.transformers.");
         classLoader.addClassLoaderExclusion("LZMA.");
+        classLoader.addTransformerExclusion("org.apache.commons.lang3");
         FMLLaunchHandler.configureForServerLaunch(classLoader, this);
         FMLLaunchHandler.appendCoreMods();

launch output: https://gist.github.com/deathcap/0d9aa6e228d6c29c12fd

problem is now how to add this exclusion without modifying FML. Sponge uses a CoreMod

update: added a simple "GSFMLCoreMod" to add this exclusion, so no longer need to modify FML

… itself?

Instead of setting LaunchClassLoader's parent classloader to the system
class loader, reuse the same URLs from the system classloader for
the LaunchClassLoader which also inherits from URLClassLoader.

Now the loader's getClass().getClassLoader() is LaunchClassLoader, but,
it still mysteriously fails with ClassCastException:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:40)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
	at net.glowstone.GlowServer.main(GlowServer.java:105)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ExceptionInInitializerError
	at net.minecraft.server.MinecraftServer.main2(MinecraftServer.java:49)
	at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:43)
	... 17 more
Caused by: java.lang.ClassCastException: net.minecraft.launchwrapper.LaunchClassLoader cannot be cast to net.minecraft.launchwrapper.LaunchClassLoader
	at net.minecraftforge.fml.common.ModClassLoader.<init>(ModClassLoader.java:49)
	at net.minecraftforge.fml.common.Loader.<init>(Loader.java:184)
	at net.minecraftforge.fml.common.Loader.instance(Loader.java:161)
	at net.minecraftforge.fml.common.FMLCommonHandler.<init>(FMLCommonHandler.java:106)
	at net.minecraftforge.fml.common.FMLCommonHandler.<clinit>(FMLCommonHandler.java:96)
	... 19 more
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
	at net.glowstone.GlowServer.main(GlowServer.java:105)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at net.minecraft.launchwrapper.Launch.main(Launch.java:43)
	... 12 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:40)
	... 12 more
Caused by: java.lang.ExceptionInInitializerError
	at net.minecraft.server.MinecraftServer.main2(MinecraftServer.java:49)
	at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:43)
	... 17 more
Caused by: java.lang.ClassCastException: net.minecraft.launchwrapper.LaunchClassLoader cannot be cast to net.minecraft.launchwrapper.LaunchClassLoader
	at net.minecraftforge.fml.common.ModClassLoader.<init>(ModClassLoader.java:49)
	at net.minecraftforge.fml.common.Loader.<init>(Loader.java:184)
	at net.minecraftforge.fml.common.Loader.instance(Loader.java:161)
	at net.minecraftforge.fml.common.FMLCommonHandler.<init>(FMLCommonHandler.java:106)
	at net.minecraftforge.fml.common.FMLCommonHandler.<clinit>(FMLCommonHandler.java:96)
	... 19 more
Fixes the annoying repeating log message:

328:[21:00:43] [main/ERROR] [LaunchWrapper/mcp]: The jar file
glowstone-0.0.1-SNAPSHOT.jar has a security seal for path
net.minecraftforge.fml.common.functions, but that path is defined and not secure
Pointing to commit:

deathcap/FML@a02af74 Disable ASM event transformers for now

Disabled since these cause ClassCircularityErrors for some reason:

21:26:57] [main/ERROR] [LaunchWrapper]: A critical problem occurred registering the ASM transformer class $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer
java.lang.ClassNotFoundException: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_72]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_72]
	at net.minecraft.launchwrapper.LaunchClassLoader.registerTransformer(LaunchClassLoader.java:88) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:118) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_72]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_72]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_72]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_72]
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.glowstone.GlowServer.main(GlowServer.java:105) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer@e0e37b3 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:234) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	... 13 more
Caused by: java.lang.ClassCircularityError: net/minecraftforge/fml/common/eventhandler/Event
	at net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer.buildEvents(EventSubscriptionTransformer.java:85) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer.transform(EventSubscriptionTransformer.java:62) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:230) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	... 13 more
[21:26:57] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.RuntimeException: java.lang.ClassNotFoundException: net.minecraftforge.fml.common.asm.FMLSanityChecker
	at net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:155) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_72]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_72]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_72]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_72]
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.glowstone.GlowServer.main(GlowServer.java:105) [glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
Caused by: java.lang.ClassNotFoundException: net.minecraftforge.fml.common.asm.FMLSanityChecker
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_72]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_72]
	at java.lang.Class.forName0(Native Method) ~[?:1.7.0_72]
	at java.lang.Class.forName(Class.java:274) ~[?:1.7.0_72]
	at net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:143) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	... 9 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.BlamingTransformer@357c4ab7 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:234) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_72]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_72]
	at java.lang.Class.forName0(Native Method) ~[?:1.7.0_72]
	at java.lang.Class.forName(Class.java:274) ~[?:1.7.0_72]
	at net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:143) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	... 9 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/JavaVersion
	at net.minecraftforge.fml.common.asm.transformers.BlamingTransformer$VersionVisitor.visit(BlamingTransformer.java:60) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:622) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:506) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.common.asm.transformers.BlamingTransformer.transform(BlamingTransformer.java:39) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:230) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_72]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_72]
	at java.lang.Class.forName0(Native Method) ~[?:1.7.0_72]
	at java.lang.Class.forName(Class.java:274) ~[?:1.7.0_72]
	at net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:143) ~[glowstone-0.0.1-SNAPSHOT.jar:git-Glowstone-1.8-225-g2125021]
	... 9 more
21:26:57 [INFO] This server is running Glowstone version git-Glowstone-1.8-225-g2125021 (Implementing API version 1.8-R1-SNAPSHOT)
21:26:58 [INFO] Recipes: 295 shaped, 63 shapeless, 24 furnace, 15 fuels.
@deathcap
Copy link
Contributor Author

Rebased on master to resolve conflicts, mod "loading" works again: https://gist.github.com/deathcap/d366631d22220d54f25d - but the problem of having the mods usefully interface with the server is still unsolved.

Another interesting problem came up in discussion on Gitter yesterday is supporting the Forge wire protocol in Glowstone++. First step is updating the server list ping packet (lists server type, installed mods, whether client mods are allowed), PR'd this separately in #153. Server type will likely need to change to FML (from BUKKIT).

Next step is supporting the Forge/FML handshaking protocol, for reference, this is how Bungeecord does it: SpigotMC/BungeeCord#1091 SpigotMC/BungeeCord#899 - FML|HS (Forge Mod Loader Handshake) channel, FML, FORGE channels. Handshake includes mod list and mod id data.

If only the Forge handshake protocol is supported, then client/server mods would have to be ported specifically to run on Glowstone++ servers (since they almost always depend on Minecraft internals not present here), but interoperating with existing client mods may be a (remote) possibility. Upon receiving fml:gameDataSnapshot (FML_GAMEDATA_SNAPSHOT) (the Mod Registry mapping - list of blocks and items), dynamically extend the org.bukkit.Material enum appropriately? (reference: Of Hacking Enums and Modifying "final static" Fields )

@liach
Copy link

liach commented Jan 19, 2016

Somehow FML is dead. You should change the submodule to minecraft forge...

@gabizou
Copy link
Contributor

gabizou commented Jan 19, 2016

FML was integrated into Forge as there was little to no reason to keep them separate as a modding library and mod loading library. There are other libraries available as mod loaders (LiteLoader is a pretty neat one that relies on Mixins, and has been intending to be as compatible with almost all mods as possible). Personally, I don't see much of a reason for FML to be included in GS++ when bukkit plugins are the only things really supported currently. FML itself supports much more on top of Minecraft including class transformations (which are entirely separate from the Bukkit API usage).

Just my two cents.

@mastercoms
Copy link
Member

Forge is too connected to Mojang's code to be acceptable for Glowstone.

Closing as this will never get pulled.

@mastercoms mastercoms closed this Feb 29, 2016
@deathcap
Copy link
Contributor Author

deathcap commented Mar 1, 2016

I think it may be possible to use some parts of FML (Forge Mod Loader, or more specifically the mod loading pieces of what is now integrated into MinecraftForge as liach mentions) within Glowstone, the mod class loading is mostly generic enough, but much of the other functionality such as the registries (for items, blocks, recipes, etc.) does rely on internal Mojang classes (which had to be stubbed to make this PR work), so I agree it's probably not feasible nor desirable or useful at least as currently designed to include FML in Glowstone++; leaving closed.

@mastercoms
Copy link
Member

I guess we could use it if we ever provided an API for mod-like things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants