anatawa12 / ForgeGradle-1.2

This is only for FG_1.2(for minecraft 1.7.10). Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
80 stars 30 forks source link

Core Modding #109

Closed terminated-star closed 2 years ago

terminated-star commented 2 years ago

Hi, I'm trying to create a core mod, I am using the example project as my base. I haven't created a core mod before, so I am not very knowledgeable in this area. I was following this tutorial and to register my mod as a core mod, I needed to add -Dfml.coreMods.load=example.Plugin to my VM options, but when I do, nothing changes (my core mod isn't ran). I am guessing that in newer versions of ForgeGradle this option was removed, and possibly forge automatically detects them(?). The core mod does register if I run the game with the MANIFEST.MF file stating that it is a core mod, but then I need to build and then manually merge the manifest file in the compiled jar file, which is pretty time consuming.

Thanks!

terminated-star commented 2 years ago

I figured it out! I fixed it by adding the following to my build.gradle:

jar {
    manifest {
        attributes(
                "FMLCorePluginContainsFMLMod": true,
                "FMLCorePlugin": "example.Plugin"
        )
    }
}

FMLCorePluginContainsFMLMod isn't necessary if your mod isn't also a regular mod, and FMLCorePlugin should be the class that implements IFMLLoadingPlugin.