From d0a44e6ddb9aec4167c63dc77377e9fb76d57f50 Mon Sep 17 00:00:00 2001 From: Drc-DEV Date: Thu, 19 Nov 2020 01:22:57 +0100 Subject: [PATCH] Add exclusions to initAll --- pom.xml | 2 +- src/main/java/pro/dracarys/configlib/ConfigLib.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0ef615e..650e8fe 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ pro.dracarys configlib ConfigLib - 1.3 + 1.4 https://dracarys.pro jar diff --git a/src/main/java/pro/dracarys/configlib/ConfigLib.java b/src/main/java/pro/dracarys/configlib/ConfigLib.java index 5d765cb..bc3590a 100644 --- a/src/main/java/pro/dracarys/configlib/ConfigLib.java +++ b/src/main/java/pro/dracarys/configlib/ConfigLib.java @@ -3,6 +3,7 @@ import org.bukkit.plugin.java.JavaPlugin; import pro.dracarys.configlib.config.CustomFile; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -40,8 +41,9 @@ public static void init(String fileName) { fileMap.get(fileName).init(); } - public static void initAll() { + public static void initAll(String... excluded) { for (CustomFile file : fileMap.values()) { + if (excluded != null && Arrays.stream(excluded).anyMatch(s -> file.getName().equalsIgnoreCase(s))) continue; file.init(); } }