Jump to content

Can we delay mod loading?


Lycanus Darkbinder

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)? :P

 

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.

Link to comment
Share on other sites

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)? :P

 

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.

Link to comment
Share on other sites

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)? :P

 

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.

Link to comment
Share on other sites

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)? :P

 

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.