Added a simple Update Checker

This commit is contained in:
Sn0wStorm
2015-01-09 18:08:38 +01:00
parent 224e096448
commit a8720e01c0
5 changed files with 208 additions and 11 deletions
+9 -9
View File
@@ -36,9 +36,10 @@ import com.dre.brewery.integration.LogBlockBarrel;
public class P extends JavaPlugin {
public static P p;
public static String configVersion = "1.3";
public static String configVersion = "1.3.1";
public static boolean debug;
public static boolean useUUID;
public static boolean updateCheck;
// Third Party Enabled
public boolean useWG; //WorldGuard
@@ -90,6 +91,10 @@ public class P extends JavaPlugin {
p.getServer().getScheduler().runTaskTimer(p, new BreweryRunnable(), 650, 1200);
p.getServer().getScheduler().runTaskTimer(p, new DrunkRunnable(), 120, 120);
if (updateCheck) {
p.getServer().getScheduler().runTaskLaterAsynchronously(p, new UpdateChecker(), 135);
}
this.log(this.getDescription().getName() + " enabled!");
}
@@ -205,6 +210,9 @@ public class P extends JavaPlugin {
}
}
// If the Update Checker should be enabled
updateCheck = config.getBoolean("updateCheck", false);
// Third-Party
useWG = config.getBoolean("useWorldGuard", true) && getServer().getPluginManager().isPluginEnabled("WorldGuard");
if (useWG) {
@@ -656,10 +664,6 @@ public class P extends JavaPlugin {
// Runnables
public class DrunkRunnable implements Runnable {
public DrunkRunnable() {
}
@Override
public void run() {
if (!BPlayer.isEmpty()) {
@@ -669,10 +673,6 @@ public class P extends JavaPlugin {
}
public class BreweryRunnable implements Runnable {
public BreweryRunnable() {
}
@Override
public void run() {
for (BCauldron cauldron : BCauldron.bcauldrons) {