[API] PluginUpdater [With Website] 2.0

Auto update your Plugin

  1. Bentipa
    Contributors:
    Bentipa
    Hello,
    because i wanted to have an automatic Updater for my Plugin, i made following class to make it easier and i want to share it with you.
    To have an automatic download you need to have your own Webspace(/Website) because i cant get the plugin out of the Spigot forum, because it is blocked because of the DDos Protection i think.
    You can get a free Website at www.bplaced.net for example.

    1. Implement Updater
    At first you have to download the API Jarfile and add it like any other API.
    In your onEnable() Method you write :
    Code (Text):
    SpigotPluginUpdater spu = new SpigotPluginUpdater(this/*Your Plugin*/, "http://www.yourdomain.com/plugin[or your plugin name].html");
            spu.enableOut(); // Enables an Output if there is a new Update and if the file was downloaded
           //spu.disableOut(); Disables the output
            if(spu.needsUpdate()) // Check if there is an Update availible
            //...
     
    2. Create the HTML-Information File
    Now to the plugin[or your plugin name].html:
    Code (Text):

    <html>
    <item>
    <h1>v1.0 [Version]</h1>
    <p>Plugin.jar[File name, or URL(see Step "External Jar")]</p>
    <p>
    Changes: [Changelog which will be displayed in console]
    - update version
    </p>
    </item>
    </html>
     
    Just save this HTML-File in your webspace.
    3. Update the Plugin
    Code (Text):

    // When you want to update your Plugin which is in the same folder as your plugin.html[or so]:
    spu.update(); // The Plugin will be automatically update
     
    3.1 External Jar
    If your Plugin.jar isnt in the same Folder as your plugin.html replace the plugin.jar in the html file with your external URL to you Plugin.jar.
    Now to update the Plugin:
    Code (Text):

    spu.externalUpdate();
     

    Plugins which use AutoUpdater:
    • (write me if you use it and I will add it here)
    Information:
    (If you want to use the code directly inside your Plugin too:) you have to credit me on the Plugin Page and in the code!
    Class: https://www.stealth-coders.de/download/SpigotPluginUpdater.java

    If there are Bugs or something else, post in discussion or send me a pm.
    Thanks,
    Bentipa

    8Marc8, Biesterfels, gregoryg and 4 others like this.

Recent Updates

  1. Code Update, Style Update
  2. Package Problem
  3. Fixed Version Problems

Recent Reviews

  1. LuckyZeeRo
    LuckyZeeRo
    5/5,
    Version: 2.0
    Thanks for that work! I wanted to find out how to update my plugin (for example private) from external site, but nothing found. I looked to source code and it's clear, no-depended on bukkit update utils and working!
    But, I would like to change some things:
    - Dynamic number sub-versions (instead of 2 in code), for example I'm using 3 main and fourth as test build. Depending of the author.
    - Returning result from method, not to log messages inside API, ability to handle this by plugin.
    All other are ok, tested it, works perfectly.
  2. minecrafters
    minecrafters
    5/5,
    Version: 2.0
    THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1. Bentipa
      Author's Response
      no prob, remember to tag me, else your resource will be removed^^
  3. onno204
    onno204
    5/5,
    Version: 1.1
    Great Plugin, when a stupid owner doesn't wanna update my plugin :D
    i'm a developer on a server, but the owner doesn't trust me(if i hated that server I would already have maded something that i could have op). so now i can just reload the server en "Vola" they'r is the updated version.
    1. Bentipa
  4. ImFlecki
    ImFlecki
    5/5,
    Version: 1.1
    YEAH