danik159

Untitled

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