Jump to content

Insert an Update Checker that notifies players?


ItsAMysteriousYT

Recommended Posts

Instead of coding it yourself, you could also use a mod like [url=http://2091981/]VersionChecker[/url] - all you do is add 2 lines of code to your main class and place a 'versionlist.json' online, such as in your Github repository, and voilá, version checking implemented with a nice interface from the main game menu, ability to download your mod directly from there / see the change log, etc.

Example code:
[code
// put this within FMLInitializationEvent
String link = "https://raw.githubusercontent.com/coolAlias/ZeldaSwordSkills/master/src/main/resources/versionlist.json";
FMLInterModComms.sendRuntimeMessage(ModInfo.ID, "VersionChecker", "addVersionCheck", link);

Note that it's important to use the 'raw' form of the .json, otherwise VC can't read it.

Link to comment
Share on other sites

I've got a tutorial on making a version checker here: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-making-mod.html

 

Basically during loading it checks a string versus a web page and sets a field to indicate whether it is latest version. If not, after the game starts it will display a chat message to the player.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.

×
×
  • Create New...

Important Information

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