Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. package me.events;
  2.  
  3. import java.text.SimpleDateFormat;
  4. import java.util.Date;
  5. import java.util.UUID;
  6.  
  7. import de.omel.api.file.FileBuilder;
  8.  
  9. public class PlayerData {
  10.  
  11. private FileBuilder fb;
  12. private UUID uuid;
  13.  
  14. public PlayerData(UUID uuid) {
  15. fb = new FileBuilder("plugins//PowerBans//PlayerData//", uuid.toString() + ".yml");
  16. fb.save();
  17. this.uuid = uuid;
  18.  
  19. }
  20.  
  21. public boolean exist() {
  22. return fb.exist();
  23.  
  24. }
  25.  
  26. public void setTempBanned(String from, String reason, long time) {
  27. fb.setValue("tempban.istempbanned", true);
  28. fb.setValue("tempban.from", from);
  29. fb.setValue("tempban.reason", reason);
  30. fb.setValue("tempban.duration", time);
  31. fb.setValue("tempban.timestamp", new SimpleDateFormat("dd.MM.yyyy HH:mm").format(new Date()));
  32. fb.save();
  33. }
  34.  
  35. public void setUnTempbanned() {
  36. fb.setValue("tempban", null);
  37. fb.save();
  38.  
  39. }
  40.  
  41. public String getTempBannedReason() {
  42. return fb.getString("tempban.reason");
  43. }
  44.  
  45. public String getTempBannedFrom() {
  46. return fb.getString("tempban.from");
  47. }
  48.  
  49. public long getTempBanMilliseconds() {
  50. return fb.getLong("tempban.duration");
  51.  
  52. }
  53.  
  54. public String getTempbanTimestamp() {
  55. return fb.getString("tempban.timestamp");
  56. }
  57.  
  58. public boolean isTempbanned() {
  59. return fb.getBoolean("tempban.istempbanned");
  60. }
  61.  
  62. public void setMuted(boolean muted) {
  63. fb.setValue("muted", muted);
  64. fb.save();
  65. }
  66.  
  67. public boolean isMuted() {
  68. return fb.getBoolean("muted");
  69. }
  70.  
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement