Geforce Posted November 14, 2015 Posted November 14, 2015 Hello everyone, Today, I'm going to show you how to use Forge's built-in version update checker found in v11.14.3.1549 and later. First, create an update.json file. Reveal hidden contents First, you will need to create an update.json file. Forge will use that to compare versions, provide the correct changelogs, provide a link to the download page, and such. LexManos has already created an example .json file which you can look at here. Let's run through the format used in that file: NOTE: If you want, you can copy Lex's file, and replace values while you read. NOTE 2: Currently, only Forge for Minecraft 1.8 has this feature. Although I show you how to have builds for multiple versions of Minecraft, you will only need to do this when Forge for Minecraft 1.8.8 or 1.9 comes out. "homepage" is the URL that Forge will display when someone uses an out-of-date version of your mod. I personally use the link to my CurseForge 'files' page here. "promos" is where you define the "latest" and "recommended" versions of your mod for the version of Minecraft you're using, and the changelogs for them. Create "{MinecraftVersion}-latest" and "{MinecraftVersion}-recommended" keys, replacing "{MinecraftVersion}" with the version of Minecraft it's for. For the value, type the version of your mod you want to use. This format sort of follows Forge's build system, "latest" is the newest version available, and "recommended" is the latest stable build. You may have keys for multiple versions of Minecraft as well, as shown below. So far, your file should look something like this: Reveal hidden contents "homepage": "http://minecraft.curseforge.com/mc-mods/64760-securitycraft-mod/files", "promos": { "1.7.10-latest": "v1.8.0", "1.7.10-recommended": "v1.7.1", "1.8-latest": "v1.8.0", "1.8-recommended": "v1.7.1" }, Next, you may define the changelogs for each version. Create a new array, like this. Again, replace {MinecraftVersion} with the version of Minecraft you're defining: // Snipped... "1.8-recommended": "v1.8.0" }, "{MinecraftVersion}: { "v1.8.0": "changelog" } Once you've done that, define the changelog for each version that you use, with your mod's version as the key. You may have changelogs for multiple versions in the array as well. Use "\n" if you want to go to a new line. Example: "1.7.10: { "v1.8.0": "This is the changelog for v1.8.0 for MC 1.7.10 of my mod!\nNew blocks, items, and more.", "v1.7.1": "This is the changelog for v1.7.1 for MC 1.7.10 of my mod!\nTons of new bugfixes!" }, "1.8: { "v1.8.0": "This is the changelog for v1.8.0 for MC 1.8 of my mod!\nNew blocks, items, and more.", "v1.7.1": "This is the changelog for v1.7.1 for MC 1.8 of my mod!\nTons of new bugfixes!" } You may add as many versions as you want. Once you're done, move on to the next step. Lastly, add the URL of your newly created file to your @Mod annotation. Reveal hidden contents After you've created your update .json file, upload it to a server, and get the URL for it. If you don't have your own website or server, Github is a great alternative. Simply push the file to your Github repository, and copy the raw link to it (should look something like https://www.github.com/Geforce/MyRepo/raw/master/update.json). Finally, once you've copied the link, simply paste it into your @Mod annotation with "updateJSON" as the key, like this: @Mod(modid = "mymod", name = "My mod!", version = "v1.7.1", updateJSON = "{LINKHERE}") ...And you're done! If someone uses an outdated version of your mod, Forge will show a download link and changelog for the new version, using the info you've provided. Hope this helps! 1 Quote Potato's have skin. I have skin. Therefore, i am a potato. Follow me on Twitter! http://www.twitter.com/I_Mod_Minecraft
theOriginalByte Posted January 8, 2016 Posted January 8, 2016 I'm trying to do that except I am using gist. Would that cause a problem? The game isn't listing that I have a new version available even though I made a dummy new version entry into the JSON file. My files are here: https://github.com/KaminoCoding/CommuMod/blob/develop-1.8/src/main/java/io/cyb3rwarri0r8/commumod/Commumod.java#L57 https://gist.github.com/Cyb3rWarri0r8/bc388f17e518a76e3b17 TLDR; It's not working with a raw gist link from the file hosted on Github and I have no idea what could be wrong. Quote
LexManos Posted January 11, 2016 Posted January 11, 2016 The problem with gist is that the raw links include the hashses for the file itself so it literally will never update because the server will see it as a different file and make it a different link, so dont use gist. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
theOriginalByte Posted January 12, 2016 Posted January 12, 2016 On 1/11/2016 at 9:16 PM, LexManos said: The problem with gist is that the raw links include the hashses for the file itself so it literally will never update because the server will see it as a different file and make it a different link, so dont use gist. Ahh... I don't know why I didn't think about that.. thank you! 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.