Skip to content
gegy1000 edited this page May 16, 2017 · 3 revisions

Update checker

This has been deprecated in favor of Forge's update checker system.

JSON

The JSON format of the update checker is fairly simple. The JSON file has the following properties:

Property Type Description
version String The latest version
updateURL String The URL the user will get redirected too when Update gets clicked
iconURL String The URL to the mod logo. This icon doesn't have to be square and will get resized accordingly
versions String Map the versions and their changelogs. All newlines should be added as new array objects

A good way to upload the JSON file is through Pastebin. Be sure to be logged in before you create a paste, so you can update the JSON file to push out new versions!

Registering

To activate the update checker, you have to register it. You can do this by calling UpdateHandler.INSTANCE.registerUpdateChecker() BEFORE FMLPostInitializationEvent.
The first argument is the main mod class, the class with the @Mod annotation. If you register the update checker with the wrong object, it won't work. The second argument is the link to the JSON file. If you use Pastebin, be sure to link to the raw paste!

Example

LLibrary also uses the update checker itself. LLibrary uses the folowwing code to register its update checker:

UpdateHandler.INSTANCE.registerUpdateChecker(LLibrary.INSTANCE, "http://pastebin.com/raw/qh3Pnuuk");
Clone this wiki locally