Guest User

Untitled

a guest
Jan 11th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. package com.Morkaz.skMorkaz.main;
  2.  
  3. import java.io.File;
  4.  
  5. import org.bukkit.configuration.file.FileConfiguration;
  6. import org.bukkit.ChatColor;
  7.  
  8. public class ConfigLoader {
  9. //Static generals
  10. public static FileConfiguration config;
  11. public static Boolean loadForceLogin;
  12.  
  13. //Static folders location
  14. public static String pluginFolder;
  15. public static String NBSFolder;
  16.  
  17. //Static email variables
  18. public static String emailServerHost;
  19. public static int emailPort;
  20. public static String emailUsername;
  21. public static String emailPassword;
  22. public static String emailPasswordRequired;
  23. public static String emailTLSRequired;
  24.  
  25. main core;
  26.  
  27. public ConfigLoader(main core){
  28. this.core = core;
  29. ConfigLoader.NBSFolder = core.getConfig().getString("MusicFolder");
  30. ConfigLoader.loadForceLogin = core.getConfig().getBoolean("ForceLogin");
  31.  
  32. ConfigLoader.emailServerHost = core.getConfig().getString("Email.EmailServer");
  33. ConfigLoader.emailPort = core.getConfig().getInt("Email.EmailPort");
  34. ConfigLoader.emailPasswordRequired = core.getConfig().getString("Email.EmailAuthRequired");
  35. ConfigLoader.emailTLSRequired = core.getConfig().getString("Email.EmailTLSRequired");
  36. ConfigLoader.emailUsername = core.getConfig().getString("Email.EmailUsername");
  37. ConfigLoader.emailPassword = core.getConfig().getString("Email.EmailPassword");
  38. }
  39.  
  40. public void Load() {
  41. if (new File(core.getDataFolder() + File.separator + "config.yml").exists() == false) {
  42. core.saveDefaultConfig();
  43. System.out.println(ChatColor.translateAlternateColorCodes('&', "&f[&9Sk&b&lMorkaz&f] &3&lDefault config generated!!"));
  44. }
  45. File nbsDir = new File(core.getDataFolder() + File.separator + "NBSFiles");
  46. if (!nbsDir.exists()){
  47. nbsDir.mkdir();
  48. }
  49. config = core.getConfig();
  50. pluginFolder = core.getDataFolder().getAbsolutePath();
  51. }
  52.  
  53. public ConfigLoader getIntance(){
  54. return this;
  55. }
  56. }
Add Comment
Please, Sign In to add comment