TerrificTable55

Untitled

Nov 13th, 2022
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. public class ConfigManager {
  2.  
  3.     List<Config> configs = new ArrayList<>();
  4.  
  5.  
  6.     public ConfigManager() {
  7.  
  8.         add(new ConfigLoader());
  9.         add(new ConfigSaver());
  10.  
  11.  
  12.         if (!Files.exists(Paths.get("./NoWay"))) {
  13.             try {
  14.                 Files.createDirectory(Paths.get("./NoWay"));
  15.             } catch (IOException e) {
  16.                 e.printStackTrace();
  17.             }
  18.         }
  19.  
  20.     }
  21.  
  22.     private void add(Config config) {
  23.         this.configs.add(config);
  24.     }
  25.  
  26.  
  27.  
  28.     public void call(Config.ConfigType configType) {
  29.         for (Config config : this.configs) {
  30.             if (config.type.equals(configType)) {
  31.                 config.call((ArrayList) NoWay.modules);
  32.             }
  33.         }
  34.     }
  35.  
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment