Don't update on errory start if they asked not to update on errory start

This commit is contained in:
libraryaddict 2021-07-12 19:58:02 +12:00
parent 06dc0baafe
commit f4d19ab3ce
2 changed files with 11 additions and 3 deletions

View File

@ -217,7 +217,7 @@ public class DisguiseConfig {
@Getter
private static String savedServerIp = "";
@Getter
private static boolean autoUpdate;
private static Boolean autoUpdate;
@Getter
private static boolean notifyUpdate;
private static BukkitTask updaterTask;
@ -279,6 +279,14 @@ public class DisguiseConfig {
return getPlayerNameType() == PlayerNameType.EXTENDED;
}
public static boolean isAutoUpdate() {
if (getAutoUpdate() == null) {
autoUpdate = LibsDisguises.getInstance().getConfig().getBoolean("AutoUpdate");
}
return getAutoUpdate();
}
public static void setAutoUpdate(boolean update) {
if (isAutoUpdate() == update) {
return;

View File

@ -105,7 +105,7 @@ public class LibsDisguises extends JavaPlugin {
}
} catch (Throwable throwable) {
try {
if (isNumberedBuild()) {
if (isNumberedBuild() && DisguiseConfig.isAutoUpdate()) {
getUpdateChecker().doUpdate();
}
} catch (Throwable t) {
@ -260,7 +260,7 @@ public class LibsDisguises extends JavaPlugin {
new MetricsInitalizer();
} catch (Throwable throwable) {
try {
if (isNumberedBuild()) {
if (isNumberedBuild() && DisguiseConfig.isAutoUpdate()) {
getUpdateChecker().doUpdate();
}
} catch (Throwable t) {