Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.andrzex.EndrjuTools.managers;
- import java.util.List;
- import pl.andrzex.EndrjuTools.CorePlugin;
- public class Config
- {
- private CorePlugin plugin;
- public List<String> autoMessageMessages;
- public int autoMessageDelay;
- public String autoMessagePrefix;
- public String autoSaveMessage1;
- public String autoSaveMessage2;
- public String ChatFormat;
- public String ChatFormatVip;
- public String ChatFormatAdmin;
- public String ChatFormatModerator;
- public String ChatFormatHelper;
- public String ChatFormatGlowna;
- public String ChatFormatYT;
- public String ChatFormatTW;
- public String Host;
- public String DataBase;
- public String username;
- public String password;
- public int randomMin;
- public int randomMax;
- public int randomGroupRadius;
- public int limitKox;
- public int limitRefy;
- public int SaveDelay;
- public int slot;
- public int StoniarkaTimeRegenerate;
- public int port;
- public Config(CorePlugin plugin)
- {
- this.plugin = plugin;
- loadConfig();
- }
- public void reloadConfig()
- {
- this.plugin.reloadConfig();
- loadConfig();
- }
- public void loadConfig()
- {
- this.autoMessageMessages = this.plugin.getConfig().getStringList("config.automessage.messages");
- this.autoMessageDelay = this.plugin.getConfig().getInt("config.automessage.delay");
- this.autoMessagePrefix = this.plugin.getConfig().getString("config.automessage.prefix");
- this.autoSaveMessage1 = this.plugin.getConfig().getString("config.save.message1");
- this.autoSaveMessage2 = this.plugin.getConfig().getString("config.save.message2");
- this.ChatFormat = this.plugin.getConfig().getString("config.chat.format.gracz");
- this.ChatFormatAdmin = this.plugin.getConfig().getString("config.chat.format.admin");
- this.ChatFormatModerator = this.plugin.getConfig().getString("config.chat.format.moderator");
- this.ChatFormatHelper = this.plugin.getConfig().getString("config.chat.format.helper");
- this.ChatFormat = this.plugin.getConfig().getString("config.chat.format.gracz");
- this.ChatFormatYT = this.plugin.getConfig().getString("config.chat.format.yt");
- this.ChatFormatTW = this.plugin.getConfig().getString("config.chat.format.tw");
- this.ChatFormatVip = this.plugin.getConfig().getString("config.chat.format.vip");
- this.ChatFormatGlowna = this.plugin.getConfig().getString("config.chat.format.glowna");
- this.randomMin = this.plugin.getConfig().getInt("config.randomtp.min");
- this.randomMax = this.plugin.getConfig().getInt("config.randomtp.max");
- this.randomGroupRadius = this.plugin.getConfig().getInt("config.randomtp.groups.radius");
- this.limitKox = this.plugin.getConfig().getInt("config.limit.koxy");
- this.limitRefy = this.plugin.getConfig().getInt("config.limit.refy");
- this.SaveDelay = this.plugin.getConfig().getInt("config.save.delay");
- this.slot = this.plugin.getConfig().getInt("config.sloty");
- this.port = this.plugin.getConfig().getInt("config.baza.mysql.port");
- this.Host = this.plugin.getConfig().getString("config.baza.mysql.host");
- this.DataBase = this.plugin.getConfig().getString("config.baza.mysql.database");
- this.username = this.plugin.getConfig().getString("config.baza.mysql.username");
- this.password = this.plugin.getConfig().getString("config.baza.mysql.password");
- }
- public void saveConfig()
- {
- this.plugin.getConfig().set("config.automessage.messages", this.autoMessageMessages);
- this.plugin.getConfig().set("config.automessage.delay", Integer.valueOf(this.autoMessageDelay));
- this.plugin.getConfig().set("config.automessage.prefix", this.autoMessagePrefix);
- this.plugin.getConfig().set("config.save.message1", this.autoSaveMessage1);
- this.plugin.getConfig().set("config.save.message2", this.autoSaveMessage2);
- this.plugin.getConfig().set("config.chat.format.gracz", this.ChatFormat);
- this.plugin.getConfig().set("config.chat.format.yt", this.ChatFormatYT);
- this.plugin.getConfig().set("config.chat.format.tw", this.ChatFormatTW);
- this.plugin.getConfig().set("config.chat.format.admin", this.ChatFormatAdmin);
- this.plugin.getConfig().set("config.chat.format.moderator", this.ChatFormatModerator);
- this.plugin.getConfig().set("config.chat.format.helper", this.ChatFormatHelper);
- this.plugin.getConfig().set("config.chat.format.vip", this.ChatFormatVip);
- this.plugin.getConfig().set("config.chat.format.glowna", this.ChatFormatGlowna);
- this.plugin.getConfig().set("config.randomtp.min", Integer.valueOf(this.randomMin));
- this.plugin.getConfig().set("config.randomtp.max", Integer.valueOf(this.randomMax));
- this.plugin.getConfig().set("config.randomtp.groups.radius", Integer.valueOf(this.randomGroupRadius));
- this.plugin.getConfig().set("config.limit.koxy", Integer.valueOf(this.limitKox));
- this.plugin.getConfig().set("config.limit.refy", Integer.valueOf(this.limitRefy));
- this.plugin.getConfig().set("config.save.delay", Integer.valueOf(this.SaveDelay));
- this.plugin.getConfig().set("config.sloty", Integer.valueOf(this.slot));
- this.plugin.getConfig().set("config.baza.mysql.port", Integer.valueOf(this.port));
- this.plugin.getConfig().set("config.baza.mysql.host", this.Host);
- this.plugin.getConfig().set("config.baza.mysql.databse", this.DataBase);
- this.plugin.getConfig().set("config.baza.mysql.username", this.username);
- this.plugin.getConfig().set("config.baza.mysql.password", this.password);
- this.plugin.saveConfig();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement