Hi can someone help me adding an auto updater to my plugin. I have added this code to my main class file in my onEnable(): Code: if (getConfig().getBoolean("AutoUpdate", true)) { @SuppressWarnings("unused") Updater localUpdater = new Updater(this, id, getFile(), Updater.UpdateType.DEFAULT, true); } else { getLogger().info("NOT AUTO-UPDATING"); } } I am using Gravity's updater so I have added their updater class file to my plugin as well. The problem is I don't know how to get my ID. Can someone explain. If its the Server API Key its a really long number and when I try to use that for some reason I get errors flying up all over the place. I'm also getting errors in the updater.class file and I'm not sure why? Thanks in advance Vidsify
@Vidsify This is the id to your plugin as found on https://api.curseforge.com/servermods/projects?search=yourPlugin
@Vidsify No, what you need to do is visit the link, replacing "yourPlugin" with the name of your plugin as you uploaded it to bukkitdev. On the page, it should display some details, like this: So you can see, the id for one of my plugins is 85467. You'll want to visit the page for your plugin and note down your id, which you'll use in the updater.
Ok cheers Went to https://api.curseforge.com/servermods/projects?search=double-your-experience Code: [{"id":80039,"name":"Double Your Experience ","slug":"double-your-experience","stage":"release"}] I take the ID and place it in the code I mentions above
@Vidsify Yup! If you still can't get it to work after entering the id (80039 by what you've posted) then let us know
@Vidsify You never declared those variables. As a side note, I see we have some things in common - I too took Phyiscs and Chemistry (but never did or see anyone do the DofE)
@AdamQpzm ah lol ok and yeah I do maths, physics, chemistry and computer science. In my first year of AS. I've change the code to this: But getting a yellow line :/
@Vidsify That warning is most likely an "unused" warning, since you never use that variable after that line
@Vidsify You can just leave it if you want, but I'd recommend actually using it For example, there's a getResult() method that will allow you to actually see what the result of the updater was, might be useful