Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void reloadReclaim() {
- if (reclaimFile == null) {
- reclaimFile = new File(getDataFolder(), "reclaim.yml");
- }
- reclaimConfig = YamlConfiguration.loadConfiguration(reclaimFile);
- Reader defConfigStream = null;
- try {
- defConfigStream = new InputStreamReader(this.getResource("reclaim.yml"), "UTF8");
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if (defConfigStream != null) {
- YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
- reclaimConfig.setDefaults(defConfig);
- }
- }
- public FileConfiguration getReclaim() {
- if (reclaimConfig == null) {
- reloadReclaim();
- }
- return reclaimConfig;
- }
- public void saveReclaim() {
- if (reclaimConfig == null || reclaimFile == null) {
- return;
- }
- try {
- getReclaim().save(reclaimFile);
- } catch (IOException ex) {
- getLogger().log(Level.SEVERE, "Could not save config to " + reclaimFile, ex);
- }
- }
- public void saveDefaultReclaim() {
- if (reclaimFile == null) {
- reclaimFile = new File(getDataFolder(), "reclaim.yml");
- }
- if (!reclaimFile.exists()) {
- getLogger().log(Level.WARNING, "No previous dbs file was found! Creating one now...");
- saveResource("dbs.yml", false);
- getLogger().log(Level.INFO, "dbs file was created!");
- }
- }
- (REPLACE THOSE)
Add Comment
Please, Sign In to add comment