Fix confi classes

This commit is contained in:
Frank 2021-08-17 12:56:09 +02:00
parent 123a5e2dc4
commit 29fe59b4b9

View file

@ -29,43 +29,39 @@ public class AutoSync {
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public static class ClientConfig { static class ClientConfig {
@Environment(EnvType.CLIENT) public static boolean shouldPrintDebugHashes() {
static boolean shouldClientConfigPrintDebugHashes() {
return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "debugHashes", true); return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "debugHashes", true);
} }
@Environment(EnvType.CLIENT) public static boolean isAllowingAutoSync() {
static boolean isClientConfigAllowingAutoSync() {
return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true); return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true);
} }
@Environment(EnvType.CLIENT) public static boolean isAcceptingFiles() {
static boolean isClientConfigAcceptingFiles() { return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFiles", true) && isAllowingAutoSync();
return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFiles", true) && isClientConfigAllowingAutoSync();
} }
@Environment(EnvType.CLIENT) public static boolean isAcceptingFolders() {
static boolean isClientConfigAcceptingFolders() { return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFolders", true) && isAllowingAutoSync();
return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFolders", true) && isClientConfigAllowingAutoSync();
} }
} }
public static class Config { static class Config {
static boolean isAllowingAutoSync() { public static boolean isAllowingAutoSync() {
return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true); return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true);
} }
static boolean isOfferingFiles() { public static boolean isOfferingFiles() {
return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFiles", true) && ClientConfig.isClientConfigAllowingAutoSync(); return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFiles", true) && isAllowingAutoSync();
} }
static boolean isOfferingFolders() { public static boolean isOfferingFolders() {
return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFolders", true) && ClientConfig.isClientConfigAllowingAutoSync(); return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFolders", true) && isAllowingAutoSync();
} }
static boolean isOfferingMods() { public static boolean isOfferingMods() {
return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerMods", true) && ClientConfig.isClientConfigAllowingAutoSync(); return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerMods", true) && isAllowingAutoSync();
} }
} }