Skip to content

Commit

Permalink
Add exclusions to initAll
Browse files Browse the repository at this point in the history
  • Loading branch information
Drc-DEV committed Nov 19, 2020
1 parent 7a120d9 commit d0a44e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>pro.dracarys</groupId>
<artifactId>configlib</artifactId>
<name>ConfigLib</name>
<version>1.3</version>
<version>1.4</version>
<url>https://dracarys.pro</url>
<packaging>jar</packaging>

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/pro/dracarys/configlib/ConfigLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit d0a44e6

Please sign in to comment.