Guest User

Untitled

a guest
Oct 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //If we aren't using SQL lets run this.
  2. if (Config.getStorage().toLowerCase().contains("sql")) {
  3. return;
  4. }
  5. //Check to see if there is a configuration file.
  6. File yml = new File(plugin.getDataFolder(), "karma.yml");
  7.  
  8. if (!yml.exists()) {
  9. try {
  10. plugin.getDataFolder().mkdirs();
  11. yml.createNewFile();
  12. } catch (IOException ex) {
  13. return;
  14. }
  15. }
  16.  
  17. karmaConfig = new Configuration(yml);
  18. karmaConfig.load();
  19.  
  20. for (String key : karmaConfig.getKeys()) {
  21. karmaMap.put(key, karmaConfig.getInt(key, 0));
  22. }
  23. karmaConfig.save();
Add Comment
Please, Sign In to add comment