Posted April 23, 201312 yr Greetings, I've been helping TheBoo fix a recipe mod but the mod gets loaded too early so it can't validate item IDs from other mods. Is there any event or method that will delay a mod? I've looked at the event system but couldn't see anything that deals with server loading. Thanks! Edit: Links to the original thread... http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__240#entry22087354 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22091817 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22093408
April 23, 201312 yr Author Greetings, I've been helping TheBoo fix a recipe mod but the mod gets loaded too early so it can't validate item IDs from other mods. Is there any event or method that will delay a mod? I've looked at the event system but couldn't see anything that deals with server loading. Thanks! Edit: Links to the original thread... http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__240#entry22087354 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22091817 http://www.minecraftforum.net/topic/1504359-151-theboos-mods-craftable-spawners-custom-recipes-and-super-slopes/page__st__260#entry22093408
April 24, 201312 yr Check out the mcmod.info file. You can specify dependencies so your mod is loaded afterwards https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file
April 24, 201312 yr Check out the mcmod.info file. You can specify dependencies so your mod is loaded afterwards https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file
April 24, 201312 yr Author Check out the mcmod.info file. You can specify dependencies so your mod is loaded afterwards https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file The dependencies file unfortunately won't work because there's no way to tell which mods a user has at any given time. This recipe mod really needs to be loaded absolutely last so it can check item and block IDs that are added by other, unrelated mods.
April 24, 201312 yr Author Check out the mcmod.info file. You can specify dependencies so your mod is loaded afterwards https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file The dependencies file unfortunately won't work because there's no way to tell which mods a user has at any given time. This recipe mod really needs to be loaded absolutely last so it can check item and block IDs that are added by other, unrelated mods.
April 24, 201312 yr I assume you're working with specifics mods though...? You're not just loading random mods the user has and creating random recipes no (I know you may have creative usages but I can't think of anything atm)? Also, if say you're adding additional recipes for something if the user has say mod X and Y installed, if you read it's not totally clear (and I haven't had to do this) but it separates required and depdendant mods. So you can have a "soft dependency" which won't break if it doesn't exist but the dependency will load first if it exists.
April 24, 201312 yr I assume you're working with specifics mods though...? You're not just loading random mods the user has and creating random recipes no (I know you may have creative usages but I can't think of anything atm)? Also, if say you're adding additional recipes for something if the user has say mod X and Y installed, if you read it's not totally clear (and I haven't had to do this) but it separates required and depdendant mods. So you can have a "soft dependency" which won't break if it doesn't exist but the dependency will load first if it exists.
April 24, 201312 yr Author I assume you're working with specifics mods though...? You're not just loading random mods the user has and creating random recipes no (I know you may have creative usages but I can't think of anything atm)? That's exactly what the mod does. It allows the user to create text files with alternative recipes, for example: shaped (stick / stick / stick, coal / coal / coal, wood / wood / wood ) > (wool, 1) and it works fine with default items. The issue is if the user puts an item from a mod then the recipe has a chance to error if the mod hasn't been loaded yet. Since I don't have any foreknowledge of wether a user will have items: "bigBlock" or "wetLeaves", I can't use the mod dependency file. I need some way to delay loading the mod. I did find FMLClientHandler.finishMinecraftLoading() but I haven't been able to hook into it.
April 24, 201312 yr Author I assume you're working with specifics mods though...? You're not just loading random mods the user has and creating random recipes no (I know you may have creative usages but I can't think of anything atm)? That's exactly what the mod does. It allows the user to create text files with alternative recipes, for example: shaped (stick / stick / stick, coal / coal / coal, wood / wood / wood ) > (wool, 1) and it works fine with default items. The issue is if the user puts an item from a mod then the recipe has a chance to error if the mod hasn't been loaded yet. Since I don't have any foreknowledge of wether a user will have items: "bigBlock" or "wetLeaves", I can't use the mod dependency file. I need some way to delay loading the mod. I did find FMLClientHandler.finishMinecraftLoading() but I haven't been able to hook into it.
April 24, 201312 yr Author I also found this: @Mod.ServerStarted public void serverStarted(FMLServerStartedEvent event) { System.out.println("@ServerStarted"); } I put a breakpoint on that println() and it never gets called. According to the comments, ServerStarted is supposed to be called after the server is running but I guess it doesn't include the integrated server.
April 24, 201312 yr Author I also found this: @Mod.ServerStarted public void serverStarted(FMLServerStartedEvent event) { System.out.println("@ServerStarted"); } I put a breakpoint on that println() and it never gets called. According to the comments, ServerStarted is supposed to be called after the server is running but I guess it doesn't include the integrated server.
April 24, 201312 yr Author Hmm, TextureLoadEvent seems like it might work. It appears this is called last after all the mods are loaded. Perhaps the mod can then do ID validation at this point.
April 24, 201312 yr Author Hmm, TextureLoadEvent seems like it might work. It appears this is called last after all the mods are loaded. Perhaps the mod can then do ID validation at this point.
April 24, 201312 yr Author Well, it looks like Mod.PostInit delays it long enough. I couldn't test it in MCP because I didn't have other deobfuscated mods to add but it seems to work with a "live" version of Minecraft.
April 24, 201312 yr Author Well, it looks like Mod.PostInit delays it long enough. I couldn't test it in MCP because I didn't have other deobfuscated mods to add but it seems to work with a "live" version of Minecraft.
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.