Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class ConfigManager
  2. {
  3. private ServerManager SM = ServerManager.getPlugin(ServerManager.class);
  4. private Player P;
  5. File F = new File(SM.getDataFolder() + "/users/", P.getUniqueId().toString() + ".yml");
  6. FileConfiguration FC = YamlConfiguration.loadConfiguration(F);
  7.  
  8. public void Setup(Player P)
  9. {
  10. this.P = P;
  11. if(!(F.exists()))
  12. {
  13. try
  14. {
  15. F.createNewFile();
  16. }
  17. catch (IOException IOE)
  18. {
  19. IOE.printStackTrace();
  20. }
  21. }
  22.  
  23. FC = YamlConfiguration.loadConfiguration(F);
  24. FC.set("NAME", P.getName());
  25. try
  26. {
  27. FC.save(F);
  28. }
  29. catch (IOException IOE)
  30. {
  31. IOE.printStackTrace();
  32. }
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement