Posted May 23, 201510 yr I'm making an api for one of my mods where they put the api in their mod's source folder (similar to the RedstoneFlux API) and perform a check that my mod is loaded then they can use it. Simple right? But now I'm running into a problem where I can't figure out how to get my mod's config directory without using FMLPreInitializationEvent event. If your wondering why I want to do this, it's because the api will edit some files in my mod's config folder and will not be able to access the rest of my mod's files because it will be in another mod's source. So, how would I do this?
May 23, 201510 yr I'm making an api for one of my mods where they put the api in their mod's source folder (similar to the RedstoneFlux API) and perform a check that my mod is loaded then they can use it. Simple right? But now I'm running into a problem where I can't figure out how to get my mod's config directory without using FMLPreInitializationEvent event. If your wondering why I want to do this, it's because the api will edit some files in my mod's config folder and will not be able to access the rest of my mod's files because it will be in another mod's source. So, how would I do this? All you need is any directory or file inside minecraft folder or sub folders. After getting this file and it's path, you can with simple string manipulations find your mods config... For that, i recommend you to check main classes (of mc, fml and forge)... Also, there's completely other way of influencing one mod with another. Considering you have control over both - for you it's possible: Inter Mod Comms (messages sent between mods by forge). Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
May 24, 201510 yr Ya, thanks for the suggestion. I will be away from my code for a while because my computer's battery quit charging (I did a backup before it ran out of power, thankfully). So now it's a matter of putting the backup on another computer. Which isn't done yet. Oh btw, don't try to pry open a tablet to fix it, just don't. The screen shattered. Don't worry, my warranty was lapsed before I tried to replace the battery. lol
May 24, 201510 yr FMLPreInitializationEvent#getModConfigurationDirectory() gives the parent directory for the config. So you can find the another mod's configuration file there. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 24, 201510 yr Also, there's completely other way of influencing one mod with another. Considering you have control over both - for you it's possible: Inter Mod Comms (messages sent between mods by forge). So, I got all my code moved and IntelliJ setup on my other computer. I ran a test minecraft client and it works. So now I can edit my code. So how do I use Inter Mod Communications?
May 25, 201510 yr Ok, I figured it out, I was able to find a tutorial for Inter mod communication. Thanks everyone for your suggestions.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.