Advertisement
Guest User

Untitled

a guest
May 1st, 2015
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. package me.newpredator;
  2.  
  3. import java.io.File;
  4. import java.util.logging.Level;
  5.  
  6. import org.bukkit.configuration.file.YamlConfiguration;
  7.  
  8.  
  9. public class Config {
  10. public static String MSG = "Your real name is:";
  11. public static boolean Enable = true;
  12. //Archive
  13. public static File configFile = new File("plugins/UtilCommands/config.yml");
  14.  
  15. public static void load() {
  16. YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
  17.  
  18. MSG = config.getString("MSG.RealName");
  19. Enable = config.getBoolean("Enable");
  20.  
  21. }
  22.  
  23. public static void save() {
  24. YamlConfiguration config = new YamlConfiguration();
  25. config.set("MSG.RealName", MSG);
  26. config.set("Boolean", Enable);
  27.  
  28. try {
  29.  
  30. config.save(configFile);
  31. UtilCommands.log.log(Level.INFO, "Config enable");
  32. } catch (Exception e) {
  33. UtilCommands.log.log(Level.WARNING, "Error in configurate (0)", e.getMessage());
  34.  
  35. }
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement