American2050 Posted January 6, 2020 Posted January 6, 2020 So I'm slowly getting back into modding for 1.14.4 and of course, a lot of things have changed and I have many questions for sure and will have even more. This is a simple one to get more information about the TOML file. We can read on it: # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it version="${file.jarVersion}" #mandatory What are and where can I find the "well known" ${} variables. And what would be the best way to not hardcode that value but be able to read it from one of the .java files in my mod structure? Quote
American2050 Posted January 6, 2020 Author Posted January 6, 2020 Is it common that when running from within IntelliJ it just comes as "NONE" I assume it's because we don't have a jar file yet. But on my mods.toml file I have version="${file.jarVersion}" and on build.gradle I have this version = '1.0' group = 'mramericanmike.terracottaworld' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'TerracottaWorld' jar { manifest { attributes([ "Specification-Title": "terracottaworld", "Specification-Vendor": "mramericanmike", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"mramericanmike", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } I think it should be good to work like that right? I'm not taking the value from a java file, but at least it will update when I change it for the build. Quote
Cadiboo Posted January 7, 2020 Posted January 7, 2020 I use the processResources block to substitute in my version. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
lgow Posted March 30, 2023 Posted March 30, 2023 On 1/6/2020 at 9:25 AM, American2050 said: jar { manifest { attributes([ "Specification-Title": "terracottaworld", "Specification-Vendor": "mramericanmike", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"mramericanmike", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } I think it should be good to work like that right? I'm not taking the value from a java file, but at least it will update when I change it for the build. Another way to do this without using "${}" is to replace the implementation version with: "Implementation-Version": project.version, Quote
Recommended Posts
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.