From 29fe59b4b9ffad5fbd7c0466c299e768f11a4552 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 17 Aug 2021 12:56:09 +0200 Subject: [PATCH] Fix confi classes --- .../handler/autosync/AutoSync.java | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java index 29ce9336..c3f2695d 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java @@ -29,43 +29,39 @@ public class AutoSync { } @Environment(EnvType.CLIENT) - public static class ClientConfig { - @Environment(EnvType.CLIENT) - static boolean shouldClientConfigPrintDebugHashes() { + static class ClientConfig { + public static boolean shouldPrintDebugHashes() { return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "debugHashes", true); } - @Environment(EnvType.CLIENT) - static boolean isClientConfigAllowingAutoSync() { + public static boolean isAllowingAutoSync() { return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true); } - @Environment(EnvType.CLIENT) - static boolean isClientConfigAcceptingFiles() { - return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFiles", true) && isClientConfigAllowingAutoSync(); + public static boolean isAcceptingFiles() { + return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFiles", true) && isAllowingAutoSync(); } - @Environment(EnvType.CLIENT) - static boolean isClientConfigAcceptingFolders() { - return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFolders", true) && isClientConfigAllowingAutoSync(); + public static boolean isAcceptingFolders() { + return Configs.CLIENT_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "acceptFolders", true) && isAllowingAutoSync(); } } - public static class Config { - static boolean isAllowingAutoSync() { + static class Config { + public static boolean isAllowingAutoSync() { return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "enabled", true); } - static boolean isOfferingFiles() { - return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFiles", true) && ClientConfig.isClientConfigAllowingAutoSync(); + public static boolean isOfferingFiles() { + return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFiles", true) && isAllowingAutoSync(); } - static boolean isOfferingFolders() { - return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFolders", true) && ClientConfig.isClientConfigAllowingAutoSync(); + public static boolean isOfferingFolders() { + return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerFolders", true) && isAllowingAutoSync(); } - static boolean isOfferingMods() { - return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerMods", true) && ClientConfig.isClientConfigAllowingAutoSync(); + public static boolean isOfferingMods() { + return Configs.MAIN_CONFIG.getBoolean(MAIN_SYNC_CATEGORY, "offerMods", true) && isAllowingAutoSync(); } }