Nocx

ep.01/24 fichiers de config

Apr 30th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public void onEnable()
  2.     {
  3.        
  4.         File config = new File(getDataFolder(), "config.yml");
  5.        
  6.         try{
  7.            
  8.             if(!config.exists())
  9.             {
  10.                 getConfig().options().copyDefaults(true);
  11.                
  12.                 getConfig().set("Option.active", Boolean.valueOf(true));
  13.                
  14.                 saveConfig();
  15.                 saveDefaultConfig();
  16.                
  17.             }
  18.            
  19.         }catch(Exception e)
  20.         {
  21.             e.printStackTrace();
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment