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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I recently reset my laptop entirely cuz i wanted to start fresh, ever since then its done this, it used to not.   ---- Minecraft Crash Report ---- WARNING: coremods are present:   XaeroMinimapPlugin (Xaeros_Minimap_24.1.1_Forge_1.12.jar)   TransformLoader (DynamicSurroundings-1.12.2-3.6.3.jar) Contact their authors BEFORE contacting forge // This doesn't make any sense! Time: 6/2/24 7:37 AM Description: Ticking memory connection java.lang.RuntimeException: PLAYER target expects a Player arg     at net.minecraftforge.fml.common.network.FMLOutboundHandler$OutboundTarget$4.validateArgs(FMLOutboundHandler.java:136)     at net.minecraftforge.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:367)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)     at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:111)     at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:704)     at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1017)     at io.netty.channel.AbstractChannel.write(AbstractChannel.java:286)     at io.netty.channel.embedded.EmbeddedChannel.writeOutbound(EmbeddedChannel.java:341)     at bspkrs.treecapitator.CommonProxy.onPlayerLoggedIn(CommonProxy.java:58)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_231_CommonProxy_onPlayerLoggedIn_PlayerLoggedInEvent.invoke(.dynamic)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)     at net.minecraftforge.fml.common.FMLCommonHandler.firePlayerLoggedIn(FMLCommonHandler.java:575)     at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:219)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:255)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.access$100(NetworkDispatcher.java:72)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:205)     at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285)     at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180)     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:279)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace:     at net.minecraftforge.fml.common.network.FMLOutboundHandler$OutboundTarget$4.validateArgs(FMLOutboundHandler.java:136)     at net.minecraftforge.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:367)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)     at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:111)     at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)     at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)     at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:704)     at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1017)     at io.netty.channel.AbstractChannel.write(AbstractChannel.java:286)     at io.netty.channel.embedded.EmbeddedChannel.writeOutbound(EmbeddedChannel.java:341)     at bspkrs.treecapitator.CommonProxy.onPlayerLoggedIn(CommonProxy.java:58)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_231_CommonProxy_onPlayerLoggedIn_PlayerLoggedInEvent.invoke(.dynamic)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)     at net.minecraftforge.fml.common.FMLCommonHandler.firePlayerLoggedIn(FMLCommonHandler.java:575)     at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:219)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:255)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.access$100(NetworkDispatcher.java:72)     at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:205)     at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) -- Ticking connection -- Details:     Connection: net.minecraft.network.NetworkManager@336bc43d Stacktrace:     at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180)     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:279)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Thread.java:745) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 650962680 bytes (620 MB) / 1375731712 bytes (1312 MB) up to 2147483648 bytes (2048 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94     FML: MCP 9.42 Powered by Forge 14.23.5.2847 Optifine OptiFine_1.12.2_HD_U_G5 24 mods loaded, 24 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State  | ID                  | Version      | Source                                        | Signature                                |     |:------ |:------------------- |:------------ |:--------------------------------------------- |:---------------------------------------- |     | LCHIJA | minecraft           | 1.12.2       | minecraft.jar                                 | None                                     |     | LCHIJA | mcp                 | 9.42         | minecraft.jar                                 | None                                     |     | LCHIJA | FML                 | 8.0.99.99    | forge-1.12.2-14.23.5.2847.jar                 | None                                     |     | LCHIJA | forge               | 14.23.5.2847 | forge-1.12.2-14.23.5.2847.jar                 | None                                     |     | LCHIJA | xaerominimap_core   | 1.12.2-1.0   | minecraft.jar                                 | None                                     |     | LCHIJA | bspkrscore          | 8.0.0        | [1.12.2]bspkrscore-universal-8.0.1.jar        | None                                     |     | LCHIJA | damageindicatorsmod | 1.0          | [1.12.2]DamageIndicatorsMod-3.5.1.jar         | None                                     |     | LCHIJA | treecapitator       | 1.43.0       | [1.12]TreeCapitator-client-1.43.0.jar         | None                                     |     | LCHIJA | bibliocraft         | 2.4.6        | BiblioCraft[v2.4.6][MC1.12.2].jar             | None                                     |     | LCHIJA | biomesoplenty       | 7.0.1.2444   | BiomesOPlenty-1.12.2-7.0.1.2444-universal.jar | None                                     |     | LCHIJA | doggytalents        | 1.15.1.6     | DoggyTalents-1.12.2-1.15.1.6.jar              | None                                     |     | LCHIJA | dragonmounts        | 1.12.2-1.6.4 | DragonMounts3-1.12.2-1.6.4.jar                | None                                     |     | LCHIJA | mocreatures         | 12.0.5       | DrZharks MoCreatures Mod-12.0.5.jar           | None                                     |     | LCHIJA | orelib              | 3.6.0.1      | OreLib-1.12.2-3.6.0.1.jar                     | 7a2128d395ad96ceb9d9030fbd41d035b435753a |     | LCHIJA | dsurround           | @VERSION@    | DynamicSurroundings-1.12.2-3.6.3.jar          | None                                     |     | LCHIJA | fastfurnace         | 1.3.1        | FastFurnace-1.12.2-1.3.1.jar                  | None                                     |     | LCHIJA | jei                 | 4.16.1.1012  | jei_1.12.2-4.16.1.1012.jar                    | None                                     |     | LCHIJA | radixcore           | 1.12.x-2.2.1 | RadixCore-1.12.x-2.2.1-universal.jar          | None                                     |     | LCHIJA | mca                 | 1.12.2-5.3.1 | MCA-1.12.x-5.3.1-universal.jar                | None                                     |     | LCHIJA | morecreeps          | 1.0.26       | morecreeps-1.0.26.jar                         | None                                     |     | LCHIJA | travelersbackpack   | 1.0.35       | TravelersBackpack-1.12.2-1.0.35.jar           | None                                     |     | LCHIJA | waymoreoresmod      | 1.3.0        | Way More Ores 1.5.5.jar                       | None                                     |     | LCHIJA | waystones           | 4.1.0        | Waystones_1.12.2-4.1.0.jar                    | None                                     |     | LCHIJA | xaerominimap        | 24.1.1       | Xaeros_Minimap_24.1.1_Forge_1.12.jar          | None                                     |     Loaded coremods (and transformers):  XaeroMinimapPlugin (Xaeros_Minimap_24.1.1_Forge_1.12.jar)   xaero.common.core.transformer.ChunkTransformer   xaero.common.core.transformer.NetHandlerPlayClientTransformer   xaero.common.core.transformer.EntityPlayerTransformer   xaero.common.core.transformer.AbstractClientPlayerTransformer   xaero.common.core.transformer.WorldClientTransformer   xaero.common.core.transformer.EntityPlayerMPTransformer   xaero.common.core.transformer.EntityPlayerSPTransformer   xaero.common.core.transformer.PlayerListTransformer   xaero.common.core.transformer.SaveFormatTransformer   xaero.common.core.transformer.GuiIngameForgeTransformer   xaero.common.core.transformer.MinecraftServerTransformer   xaero.common.core.transformer.GuiBossOverlayTransformer   xaero.common.core.transformer.ModelRendererTransformer TransformLoader (DynamicSurroundings-1.12.2-3.6.3.jar)        GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.     Profiler Position: N/A (disabled)     Player Count: 1 / 8; [EntityPlayerMP['PastelLovers'/944, l='Lifes work Zoo', x=-221.95, y=64.00, z=273.23]]     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'fml,forge'     OptiFine Version: OptiFine_1.12.2_HD_U_G5     OptiFine Build: 20210124-142939     Render Distance Chunks: 12     Mipmaps: 0     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 - Build 27.20.100.9664     OpenGlRenderer: Intel(R) UHD Graphics 630     OpenGlVendor: Intel     CpuCount: 12
    • here's my log ---> https://pastebin.com/EL7bq7UR pls help with this
  • Topics

×
×
  • Create New...

Important Information

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