Guest User

Untitled

a guest
Jan 6th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package de.mpgc.kit;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.bukkit.configuration.file.FileConfiguration;
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8.  
  9. public class Config {
  10.    
  11.     private static File file;
  12.     public static FileConfiguration cfg;
  13.    
  14.     public Config(MainClass plugin) {
  15.         Config.file = new File("plugins/selfMade", "KitPvP+.yml");
  16.         Config.cfg = YamlConfiguration.loadConfiguration(file);
  17.         Config.save();
  18.     }
  19.    
  20.     public static void save() {
  21.         try {
  22.             Config.cfg.save(file);
  23.         } catch (IOException e) {
  24.             e.printStackTrace();
  25.         }
  26.     }
  27.    
  28.     public FileConfiguration getCfg() {
  29.         return cfg;
  30.        
  31.     }
  32.     public static void loadConfig() throws IOException {
  33.        
  34.         cfg.save(file);
  35.        
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment