public void unBan(UnBan vote) { getBans().set(vote.getPlayer(), null); try { bans.save(bansFile); } catch (IOException e) { System.out.println("Error during bans saving, disabling VoteKick"); e.printStackTrace(); plugin.getPluginLoader().disablePlugin(plugin); } }
public void Ban(Vote vote) { String path = vote.getVoted().getName(); getBans().createSection(path); getBans().set(path + ".Date", plugin.register.date()); getBans().set(path + ".Reason", vote.getReason()); getBans().set(path + ".Voters", vote.getList()); try { bans.save(bansFile); } catch (IOException e) { System.out.println("Error during bans saving, disabling VoteKick"); e.printStackTrace(); plugin.getPluginLoader().disablePlugin(plugin); } }
public void reloadBansFile() { if (bansFile == null) { bansFile = new File(plugin.getDataFolder(), "bans.yml"); } bans = YamlConfiguration.loadConfiguration(bansFile); if (!bansFile.exists()) { InputStream defbansFile = plugin.getResource("bans.yml"); if (defbansFile != null) { YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defbansFile); bans.setDefaults(defConfig); } } try { bans.save(bansFile); } catch (IOException e) { System.out.println("Error during bans saving, disabling VoteKick"); e.printStackTrace(); plugin.getPluginLoader().disablePlugin(plugin); } }