danik159

Untitled

Aug 9th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. package com.chickenstyle.report;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5. import java.util.UUID;
  6.  
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8.  
  9. public class ReportsYML {
  10.  
  11. private File file;
  12. private YamlConfiguration config;
  13. String[] list;
  14. public ReportsYML(Main main) {
  15. file = new File(main.getDataFolder(), "Reports.yml");
  16. if (!file.exists()) {
  17. try {
  18. file.createNewFile();
  19. } catch (IOException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. config = YamlConfiguration.loadConfiguration(file);
  24.  
  25.  
  26. }
  27.  
  28. public void SetReason(UUID uuid,String nickname,String reportedby,String ip, String reason) {
  29. list = {reason};
  30.  
  31. config.set(uuid.toString() + "Nickname: ",nickname);
  32. config.set(uuid.toString() + "Reported By: ",reportedby);
  33. config.set(uuid.toString() + "IP: ",ip);
  34. config.set(uuid.toString() + "Reason: ",list);
  35.  
  36. }
  37.  
  38. public String getName(UUID name) {
  39. return "hello";
  40.  
  41. }
  42. public YamlConfiguration file() {
  43. return config;
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment