Guest User

Untitled

a guest
Jun 25th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. public class sPlayer {
  2.  
  3. private static HashMap<UUID, sPlayer> storage = new HashMap<>();
  4.  
  5. private int Admin;
  6. private int Level;
  7. private int Bank;
  8. private int Cash;
  9. private int Deaths;
  10.  
  11. public sPlayer(UUID uuid) {
  12. if(Stats.playerExists(uuid.toString())) {
  13. try {
  14. ResultSet rs = MySQL.query("SELECT * FROM Stats WHERE UUID = '" +uuid+ "'");
  15. if(rs.next()) {
  16. sPlayer.setAdmin(rs.getInt("ADMIN"));
  17. sPlayer.setLevel(rs.getInt("LEVEL"));
  18. sPlayer.setBank(rs.getInt("BANK"));
  19. sPlayer.setCash(rs.getInt("CASH"));
  20. sPlayer.setDeaths(rs.getInt("DEATHS"));
  21. storage.put(uuid, this);
  22. }
  23. } catch (SQLException e) {
  24. e.printStackTrace();
  25. }
  26. }
  27. }
  28.  
  29. public void setAdmin(int admin) {
  30. Admin = admin;
  31. }
  32.  
  33. public int getAdmin() {
  34. return Admin;
  35. }
  36.  
  37. public void setLevel(int level) {
  38. Level = level;
  39. }
  40.  
  41. public int getLevel() {
  42. return Level;
  43. }
  44.  
  45. public void setBank(int bank) {
  46. Bank = bank;
  47. }
  48.  
  49. public int getBank() {
  50. return Bank;
  51. }
  52.  
  53. public void setCash(int cash) {
  54. Cash = cash;
  55. }
  56.  
  57. public int getCash() {
  58. return Cash;
  59. }
  60.  
  61. public void setDeaths(int deaths) {
  62. Deaths = deaths;
  63. }
  64.  
  65. public int getDeaths() {
  66. return Deaths;
  67. }
  68.  
  69. public static sPlayer getSPlayer(UUID uuid) {
  70. return storage.get(uuid);
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment