Skip to content
This repository has been archived by the owner on May 26, 2018. It is now read-only.

Change Mod to require a name. #592

Open
wants to merge 1 commit into
base: 1.8
Choose a base branch
from

Conversation

jamierocks
Copy link

Feel free to discuss my changes.

Also change the default version to 'unknown'
@coolsquid
Copy link

I agree with this. When you're first changing it, maybe require a version too?

@Parker8283
Copy link
Contributor

Some people don't do this because their modid is the exact same thing as what their name would be. Now, I'm not saying it's ok, but I can understand why people wouldn't put a name. Also, this would break the debug mods in Forge testing.

/**
* A version string for this mod
*/
String version() default "";
String version() default "unknown";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest forcing a version number too.

@heldplayer
Copy link

I'm against forcing a version number, as my mods load the version of the mod based on a file that gets generated during build. (Because there is no easy way to add the version to the annotation and get it replaced when building)

@Parker8283
Copy link
Contributor

Uhh...in the minecraft block in your buildscript, there's a replace thing. replace "@MOD_VERSION@", project.version

Works just fine,

@matthewprenger
Copy link
Contributor

I don't agree with forcing the version in the @Mod. I personally let FML use the version.properties file to get the version, and leave the @Mod version out. This is arguably a better method than doing version replacing on source files.

@LexManos
Copy link
Member

The intended method is for the the version to be valid in the @mod so that we can pragmatically grab the data without having to actually run any code.
So it may be worth it to force this information, but i'd like to see code wise people's usecases.

@JustGregory-zz
Copy link

I concur with Lex; this is the only use case I need. The more streamlined the accessing of a version attribute is, the less likely for confusion with "alternate" mod versioning practices.

@Parker8283
Copy link
Contributor

I always have a name for my mods anyway, I just stated why people don't have names. As for the version, in dev, my version is always @MOD_VERSION@, and it gets replaced with FG, as I described above. I agree that forcing this stuff may be useful in some cases.

@jamierocks
Copy link
Author

From a bit of research some mods aren't specifying the version.
IronChest
CompactSolars
Then again some are.
Applied Energistics
Tinkers Construct

@Parker8283
Copy link
Contributor

The first two aren't because cpw always used a version.properties file (which, according to the log, is the first fallback when one isn't specified in the annotation)

jamierocks added a commit to jamierocks/MinecraftForge that referenced this pull request Nov 17, 2015
This is a port of my pr to FML back in January MinecraftForge/FML#592
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants