File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public void startup() throws UnknownHostException {
3737 URL url = new URL ("http://checkip.amazonaws.com" );
3838 BufferedReader reader = new BufferedReader (new InputStreamReader (url .openStream ()));
3939 ipaddr = reader .readLine ();
40- Main .getInstance ().getLogger ().info (ipaddr );
40+ Main .getInstance ().getLogger ().info ("IP of device: " + ipaddr );
4141 } catch (Exception e ) {
4242 Main .getInstance ().getLogger ().info ("Failed to get your public ip. Returned error is: " + e .getMessage ());
4343 }
Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ public void onEnable() {
3434 getLogger ().info ("Loading Assets." );
3535 instance .getCommand ("wsm" ).setExecutor (new Command ());
3636 instance .getCommand ("webserver" ).setExecutor (new Command ());
37- Updater .startUpdater ();
3837 if (WebServer .running ) {
3938 if (Command .ws == null ) Command .ws = new WebServer ();
4039 getLogger ().info ("Starting Webserbver." );
4140 Command .ws .start ();
4241 }
42+ Updater .startUpdater ();
4343 }
4444
4545 @ Override
Original file line number Diff line number Diff line change 1414import java .net .URL ;
1515
1616public class Updater implements Listener {
17- private static final String currentVersion = new FileManager ().getStringFromConfig ("Version" );
17+ private static String currentVersion = new FileManager ().getStringFromConfig ("Version" );
1818 private static String latestVersion ;
1919 public static void startUpdater () {
2020 Bukkit .getScheduler ().runTaskTimerAsynchronously (Main .instance , new Runnable () {
@@ -38,6 +38,10 @@ private static void checkForUpdates() {
3838 JsonObject latestRelease = releases .get (0 ).getAsJsonObject ();
3939 latestVersion = latestRelease .get ("tag_name" ).getAsString ().replace ("v" , "" );
4040
41+ if (currentVersion == null ) {
42+ currentVersion = new FileManager ().getStringFromConfig ("Version" );
43+ }
44+
4145 if (!currentVersion .equals (latestVersion )) {
4246 Bukkit .getLogger ().warning (Colors .translate ("[WebServer] A new update is available: " + latestVersion + " Your version is: " + currentVersion ));
4347 } else {
Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ WebServer:
3232 ssl : false # toggle: true/false, set this to true only if you have generated certificate and webserver pointed to domain
3333
3434No-Permission : " nemas prava L"
35- Version : 1.0 # Do not edit this line!
35+ Version : " 1.0" # Do not edit this line!
You can’t perform that action at this time.
0 commit comments