Welcome, Guest. Please login or register.

Author Topic: Why use an mcmod.info file when data could be included in the code?  (Read 904 times)

0 Members and 1 Guest are viewing this topic.

Offline HoBoS_TaCo

  • Forge Modder
  • Creeper Killer
  • ***
  • Thank You
  • -Given: 15
  • -Receive: 14
  • Posts: 125
  • Karma: +24/-1
  • Gender: Male
    • View Profile
I'm not sure if this has been asked before but i'm curious to why mcmod.info files are needed in mods when it would be more convenient to code it directly into the mod?

Offline keepcalm

  • Forge Modder
  • Diamond Finder
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 66
  • Posts: 276
  • Karma: +89/-2
  • MCPatcher is pure evil
    • View Profile
Re: Why use an mcmod.info file when data could be included in the code?
« Reply #1 on: November 24, 2012, 11:08:38 AM »
There is a way, but I can't get it to work, you can use
Code: [Select]
@Metadata("MyModID")
public static ModMetadata meta;
And modify that, or you can get the metadata from @PreInit.
Protip: try and find answers yourself before asking on the forum.
It's pretty likely that there is an answer.

Was I helpful? Give me a thank you!
Hidden

Tired of waiting for mods to port to bukkit?
use BukkitForge! (now with a working version of WorldEdit!)

Offline SanAndreasP

  • Forge Modder
  • World Shaper
  • ***
  • Thank You
  • -Given: 23
  • -Receive: 221
  • Posts: 1233
  • Karma: +300/-1
  • Gender: Male
  • Maintainer of the Clay Soldiers Mod and others
    • View Profile
Re: Why use an mcmod.info file when data could be included in the code?
« Reply #2 on: November 24, 2012, 11:45:33 AM »
The mcmod.info is for custom launchers. They can search for that file and read the information directly without searching in the class files for it.
Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |
mah twitter
This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Offline HoBoS_TaCo

  • Forge Modder
  • Creeper Killer
  • ***
  • Thank You
  • -Given: 15
  • -Receive: 14
  • Posts: 125
  • Karma: +24/-1
  • Gender: Male
    • View Profile
Re: Why use an mcmod.info file when data could be included in the code?
« Reply #3 on: November 24, 2012, 11:54:43 AM »
There is a way, but I can't get it to work, you can use
Code: [Select]
@Metadata("MyModID")
public static ModMetadata meta;
And modify that, or you can get the metadata from @PreInit.
I had a mess around with it, also with DummyContainer, and didn't have much luck.


The mcmod.info is for custom launchers. They can search for that file and read the information directly without searching in the class files for it.
Ahh. Do you have any ideas on how I would include the metadata in the code anyway?
« Last Edit: November 24, 2012, 12:20:45 PM by HoBoS_TaCo »

Offline SanAndreasP

  • Forge Modder
  • World Shaper
  • ***
  • Thank You
  • -Given: 23
  • -Receive: 221
  • Posts: 1233
  • Karma: +300/-1
  • Gender: Male
  • Maintainer of the Clay Soldiers Mod and others
    • View Profile
Re: Why use an mcmod.info file when data could be included in the code?
« Reply #4 on: November 24, 2012, 02:03:50 PM »
There is a way, but I can't get it to work, you can use
Code: [Select]
@Metadata("MyModID")
public static ModMetadata meta;
And modify that, or you can get the metadata from @PreInit.
I had a mess around with it, also with DummyContainer, and didn't have much luck.


The mcmod.info is for custom launchers. They can search for that file and read the information directly without searching in the class files for it.
Ahh. Do you have any ideas on how I would include the metadata in the code anyway?

I'm always using the mcmod.info file, so I don't know.
Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |
mah twitter
This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

 

Close
Please register or Login to join in on the community!