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 @Getter
private static String savedServerIp = ""; private static String savedServerIp = "";
@Getter @Getter
private static boolean autoUpdate; private static Boolean autoUpdate;
@Getter @Getter
private static boolean notifyUpdate; private static boolean notifyUpdate;
private static BukkitTask updaterTask; private static BukkitTask updaterTask;
@ -279,6 +279,14 @@ public class DisguiseConfig {
return getPlayerNameType() == PlayerNameType.EXTENDED; 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) { public static void setAutoUpdate(boolean update) {
if (isAutoUpdate() == update) { if (isAutoUpdate() == update) {
return; return;

View File

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