Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package pl.andrzex.EndrjuTools.managers;
  2.  
  3. import java.util.List;
  4.  
  5. import pl.andrzex.EndrjuTools.CorePlugin;
  6.  
  7. public class Config
  8. {
  9.   private CorePlugin plugin;
  10.   public List<String> autoMessageMessages;
  11.   public int autoMessageDelay;
  12.   public String autoMessagePrefix;
  13.   public String autoSaveMessage1;
  14.   public String autoSaveMessage2;
  15.   public String ChatFormat;
  16.   public String ChatFormatVip;
  17.   public String ChatFormatAdmin;
  18.   public String ChatFormatModerator;
  19.   public String ChatFormatHelper;
  20.   public String ChatFormatGlowna;
  21.   public String ChatFormatYT;
  22.   public String ChatFormatTW;
  23.   public String Host;
  24.   public String DataBase;
  25.   public String username;
  26.   public String password;
  27.   public int randomMin;
  28.   public int randomMax;
  29.   public int randomGroupRadius;
  30.   public int limitKox;
  31.   public int limitRefy;
  32.   public int SaveDelay;
  33.   public int slot;
  34.   public int StoniarkaTimeRegenerate;
  35.   public int port;
  36.  
  37.   public Config(CorePlugin plugin)
  38.   {
  39.     this.plugin = plugin;
  40.     loadConfig();
  41.   }
  42.  
  43.   public void reloadConfig()
  44.   {
  45.     this.plugin.reloadConfig();
  46.     loadConfig();
  47.   }
  48.  
  49.   public void loadConfig()
  50.   {
  51.     this.autoMessageMessages = this.plugin.getConfig().getStringList("config.automessage.messages");
  52.     this.autoMessageDelay = this.plugin.getConfig().getInt("config.automessage.delay");
  53.     this.autoMessagePrefix = this.plugin.getConfig().getString("config.automessage.prefix");
  54.     this.autoSaveMessage1 = this.plugin.getConfig().getString("config.save.message1");
  55.     this.autoSaveMessage2 = this.plugin.getConfig().getString("config.save.message2");
  56.     this.ChatFormat = this.plugin.getConfig().getString("config.chat.format.gracz");
  57.     this.ChatFormatAdmin = this.plugin.getConfig().getString("config.chat.format.admin");
  58.     this.ChatFormatModerator = this.plugin.getConfig().getString("config.chat.format.moderator");
  59.     this.ChatFormatHelper = this.plugin.getConfig().getString("config.chat.format.helper");
  60.     this.ChatFormat = this.plugin.getConfig().getString("config.chat.format.gracz");
  61.     this.ChatFormatYT = this.plugin.getConfig().getString("config.chat.format.yt");
  62.     this.ChatFormatTW = this.plugin.getConfig().getString("config.chat.format.tw");
  63.     this.ChatFormatVip = this.plugin.getConfig().getString("config.chat.format.vip");
  64.     this.ChatFormatGlowna = this.plugin.getConfig().getString("config.chat.format.glowna");
  65.     this.randomMin = this.plugin.getConfig().getInt("config.randomtp.min");
  66.     this.randomMax = this.plugin.getConfig().getInt("config.randomtp.max");
  67.     this.randomGroupRadius = this.plugin.getConfig().getInt("config.randomtp.groups.radius");
  68.     this.limitKox = this.plugin.getConfig().getInt("config.limit.koxy");
  69.     this.limitRefy = this.plugin.getConfig().getInt("config.limit.refy");
  70.     this.SaveDelay = this.plugin.getConfig().getInt("config.save.delay");
  71.     this.slot = this.plugin.getConfig().getInt("config.sloty");
  72.     this.port = this.plugin.getConfig().getInt("config.baza.mysql.port");
  73.     this.Host = this.plugin.getConfig().getString("config.baza.mysql.host");
  74.     this.DataBase = this.plugin.getConfig().getString("config.baza.mysql.database");
  75.     this.username = this.plugin.getConfig().getString("config.baza.mysql.username");
  76.     this.password = this.plugin.getConfig().getString("config.baza.mysql.password");
  77.   }
  78.  
  79.   public void saveConfig()
  80.   {
  81.     this.plugin.getConfig().set("config.automessage.messages", this.autoMessageMessages);
  82.     this.plugin.getConfig().set("config.automessage.delay", Integer.valueOf(this.autoMessageDelay));
  83.     this.plugin.getConfig().set("config.automessage.prefix", this.autoMessagePrefix);
  84.     this.plugin.getConfig().set("config.save.message1", this.autoSaveMessage1);
  85.     this.plugin.getConfig().set("config.save.message2", this.autoSaveMessage2);
  86.     this.plugin.getConfig().set("config.chat.format.gracz", this.ChatFormat);
  87.     this.plugin.getConfig().set("config.chat.format.yt", this.ChatFormatYT);
  88.     this.plugin.getConfig().set("config.chat.format.tw", this.ChatFormatTW);
  89.     this.plugin.getConfig().set("config.chat.format.admin", this.ChatFormatAdmin);
  90.     this.plugin.getConfig().set("config.chat.format.moderator", this.ChatFormatModerator);
  91.     this.plugin.getConfig().set("config.chat.format.helper", this.ChatFormatHelper);
  92.     this.plugin.getConfig().set("config.chat.format.vip", this.ChatFormatVip);
  93.     this.plugin.getConfig().set("config.chat.format.glowna", this.ChatFormatGlowna);
  94.     this.plugin.getConfig().set("config.randomtp.min", Integer.valueOf(this.randomMin));
  95.     this.plugin.getConfig().set("config.randomtp.max", Integer.valueOf(this.randomMax));
  96.     this.plugin.getConfig().set("config.randomtp.groups.radius", Integer.valueOf(this.randomGroupRadius));
  97.     this.plugin.getConfig().set("config.limit.koxy", Integer.valueOf(this.limitKox));
  98.     this.plugin.getConfig().set("config.limit.refy", Integer.valueOf(this.limitRefy));
  99.     this.plugin.getConfig().set("config.save.delay", Integer.valueOf(this.SaveDelay));
  100.     this.plugin.getConfig().set("config.sloty", Integer.valueOf(this.slot));
  101.     this.plugin.getConfig().set("config.baza.mysql.port", Integer.valueOf(this.port));
  102.     this.plugin.getConfig().set("config.baza.mysql.host", this.Host);
  103.     this.plugin.getConfig().set("config.baza.mysql.databse", this.DataBase);
  104.     this.plugin.getConfig().set("config.baza.mysql.username", this.username);
  105.     this.plugin.getConfig().set("config.baza.mysql.password", this.password);
  106.     this.plugin.saveConfig();
  107.   }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement