FANDOM


  • Hello there, Ranger. I have been trying to create a coremod for the LOTR mod, but I've run into some problems and I was hoping you could help me.

    Is it possible to have the coremod contained in the same 'mod' as the mod itself? I really don't want to require people to download two separate mods just for the sake of a few fixes. Edit: I've looked at some other mods, TerraFirmaCraft being particularly helpful, and found out how to do this. But I can't get the coremod to load in Eclipse yet.

    And how on earth do I make the coremod run in the Eclipse development environment? Edit: I found a solution here.

    Never mind!

      Loading editor
    • But now, every time I try to run the game in Eclipse with the launch configuration pointing to my coremod, I get a NoClassDefFoundError for the Mod Container class. Did you ever experience this?

      To elaborate: the no class error is for net.minecraftforge.gradle.GradleStartCommon$AccessTransformerTransformer: java.lang.ClassNotFoundException: net.minecraftforge.gradle.GradleStartCommon$AccessTransformerTransformer at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.11.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45] at net.minecraft.launchwrapper.LaunchClassLoader.registerTransformer(LaunchClassLoader.java:88) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.tweakers.AccessTransformerTweaker.injectIntoClassLoader(Unknown Source) [start/:?] at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ~[launchwrapper-1.11.jar:?] ... 8 more

      and shortly after, the actual Main class fails to load:

      Unable to launch java.lang.ClassNotFoundException: net.minecraft.client.main.Main at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.11.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_45] at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_45] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ~[launchwrapper-1.11.jar:?] ... 8 more

      I would have thought it was just a broken build, and tried refreshing the project (and I did) - except that, if I remove the coremod from my launch configuration, everything starts fine. So it cannot be a broken build or missing file, it must be something wrong with the coremod.

      The launch argument I used is -Dfml.coreMods.load=lotr.common.coremod.LOTRLoadingPlugin

        Loading editor
    • I never experienced this. Do you still use Forge 1291? If I look at the changelog of MinercaftForge, I can see some bugfixes related to coremods. I would suggest you to try a newer version of Forge (to example 10.13.4.1614). Could you post the sourcecode of lotr.common.coremod.LOTRLoadingPlugin?

        Loading editor
    • Thanks for replying. I'll try using a newer Forge version, I hadn't considered that.

      Here is the sourcecode:

      LOTRLoadingPlugin

      LOTRCoremodContainer

      Nothing interesting to see, I fear, unless I've made some silly mistake setting up the code.

        Loading editor
    • Ok, the code looks fine. I recommend you to add @MCVersion(value = "1.7.10") to LOTRLoadingPlugin to suppress some warnings in the logs on startup (this annotation sets the MC version you've specified as the target version of the coremod, the game will not load the coremod if the detected MC version doesn't match the version you've specified).

      One question: Why exactly do you use a mod container? Is there a special reason for it? I assume that the coremod is integrated in the "normal" LOTR mod, so it isn't neccessary to show the coremod in the mods list (via the mod container) as the LOTR mod is already there. And if you use the coremod only for patching vanilla classes, you shouldn't need an own id or instance for the coremod.

        Loading editor
    • Just because all the other examples I looked at used a mod container, so I assumed it was necessary for a coremod, and that I'd be forced to have it show up in the mod list. But if that's not necessary, then that's good news!

        Loading editor
    • Well, I found the problem. In the public byte[] transform method, I was returning null in the general case instead of returning the basicClass bytes... not a good idea. I must have made a mistake copying it down from an example.

      Anyway, thanks for your help!

        Loading editor
    • Say, you don't mind if I include fence/wall connection bugfixes in the mod, similar to what you've done in your coremod, do you? I wrote the code myself after I'd already done other experiments with coremodding, so it is my own work, not copied (though it achieves the same). But it is an issue in the mod that's always annoyed me, and just the other day someone on the server asked if I could fix it. I thought I'd mention it to you first so that you don't think I've gone and stolen your work.

        Loading editor
    • Hey Mevans, I assume that upgrading forge would mean that we all should load with 1614. I know another mod that is developing with 1614 and sometimes makes users upset because the game will not load with any other version. Could you possibly use 1558 instead? That is also a more stable version...

      SamwiseFilmore
        Loading editor
    • SamwiseFilmore wrote: ...use 1558 instead...

      Agreed, providing that 1558 has the necessary features to support core mods.

      MilkBucket MilkMC Check your render distance, Fandom User!MilkBucket

        Loading editor
    • Which I'm sure it does. Forge is a pretty great modding API.

      SamwiseFilmore
        Loading editor
    • LOTRMod wrote:
      Say, you don't mind if I include fence/wall connection bugfixes in the mod, similar to what you've done in your coremod, do you? I wrote the code myself after I'd already done other experiments with coremodding, so it is my own work, not copied (though it achieves the same). But it is an issue in the mod that's always annoyed me, and just the other day someone on the server asked if I could fix it. I thought I'd mention it to you first so that you don't think I've gone and stolen your work.

      Good to see that you've fixed this annoying issue! 

        Loading editor
    • SamwiseFilmore wrote:
      Hey Mevans, I assume that upgrading forge would mean that we all should load with 1614. I know another mod that is developing with 1614 and sometimes makes users upset because the game will not load with any other version. Could you possibly use 1558 instead? That is also a more stable version...
      SamwiseFilmore

      Yes, I updated to version 1558, since it's the 'Recommended' Forge version. Now, as it turned out, the problem was a very simple mistake I'd made in the code, because I didn't yet understand how it worked. It wasn't anything to do with the Forge version. But I've kept version 1558 because - why not? - it's better than version 1291 anyway. You can read the changelog here . I haven't really checked it much, but there are a great many bugfixes and other improvements.

      I have also now introduced a strict dependency to the mod which means it must have Forge version 1558 or higher, else it will just fail to load. This isn't just for Forge improvements; some method names changed since 1291, and thus running the LOTR mod with version 1291 would now break some reflection and coremod features. A nice big error message displays if you try to run a lower Forge version, which I hope will be more reliable than the huge red warning above the mod's download link. People have missed that before and had problems from running a wrong Forge version.

        Loading editor
    • Okidoki!

      Note to self and fellow-wiki-plebs: Make sure install guidelines are adjusted upon next update.

        Loading editor
    • There is a reason I added a forge version tag on the version template on the mainpage...

      But yes, a big error message like that is helpful, and using 1558 is helpful because it still allows some users some wiggle-room for using it with other mods.

      SamwiseFilmore
        Loading editor
    • Is the core mod out yet?

      Diamond Edhelgwath, Shade-Elf Diamond

        Loading editor
    •   Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.