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 {
37
37
URL url = new URL ("http://checkip.amazonaws.com" );
38
38
BufferedReader reader = new BufferedReader (new InputStreamReader (url .openStream ()));
39
39
ipaddr = reader .readLine ();
40
- Main .getInstance ().getLogger ().info (ipaddr );
40
+ Main .getInstance ().getLogger ().info ("IP of device: " + ipaddr );
41
41
} catch (Exception e ) {
42
42
Main .getInstance ().getLogger ().info ("Failed to get your public ip. Returned error is: " + e .getMessage ());
43
43
}
Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ public void onEnable() {
34
34
getLogger ().info ("Loading Assets." );
35
35
instance .getCommand ("wsm" ).setExecutor (new Command ());
36
36
instance .getCommand ("webserver" ).setExecutor (new Command ());
37
- Updater .startUpdater ();
38
37
if (WebServer .running ) {
39
38
if (Command .ws == null ) Command .ws = new WebServer ();
40
39
getLogger ().info ("Starting Webserbver." );
41
40
Command .ws .start ();
42
41
}
42
+ Updater .startUpdater ();
43
43
}
44
44
45
45
@ Override
Original file line number Diff line number Diff line change 14
14
import java .net .URL ;
15
15
16
16
public class Updater implements Listener {
17
- private static final String currentVersion = new FileManager ().getStringFromConfig ("Version" );
17
+ private static String currentVersion = new FileManager ().getStringFromConfig ("Version" );
18
18
private static String latestVersion ;
19
19
public static void startUpdater () {
20
20
Bukkit .getScheduler ().runTaskTimerAsynchronously (Main .instance , new Runnable () {
@@ -38,6 +38,10 @@ private static void checkForUpdates() {
38
38
JsonObject latestRelease = releases .get (0 ).getAsJsonObject ();
39
39
latestVersion = latestRelease .get ("tag_name" ).getAsString ().replace ("v" , "" );
40
40
41
+ if (currentVersion == null ) {
42
+ currentVersion = new FileManager ().getStringFromConfig ("Version" );
43
+ }
44
+
41
45
if (!currentVersion .equals (latestVersion )) {
42
46
Bukkit .getLogger ().warning (Colors .translate ("[WebServer] A new update is available: " + latestVersion + " Your version is: " + currentVersion ));
43
47
} else {
Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ WebServer:
32
32
ssl : false # toggle: true/false, set this to true only if you have generated certificate and webserver pointed to domain
33
33
34
34
No-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