Guest User

sPlayer

a guest
Jun 25th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.34 KB | None | 0 0
  1. public class sPlayer {
  2.    
  3.     private static HashMap<UUID, sPlayer> storage = new HashMap<>();
  4.    
  5.     private static int Admin;
  6.     private static int Level;
  7.     private static int Bank;
  8.     private static int Cash;
  9.     private static 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 static void setAdmin(int admin) {
  30.         Admin = admin;
  31.     }
  32.    
  33.     public static int getAdmin() {
  34.         return Admin;
  35.     }
  36.    
  37.     public static void setLevel(int level) {
  38.         Level = level;
  39.     }
  40.    
  41.     public static int getLevel() {
  42.         return Level;
  43.     }
  44.    
  45.     public static void setBank(int bank) {
  46.         Bank = bank;
  47.     }
  48.    
  49.     public static int getBank() {
  50.         return Bank;
  51.     }
  52.    
  53.     public static void setCash(int cash) {
  54.         Cash = cash;
  55.     }
  56.    
  57.     public static int getCash() {
  58.         return Cash;
  59.     }
  60.    
  61.     public static void setDeaths(int deaths) {
  62.         Deaths = deaths;
  63.     }
  64.    
  65.     public static int getDeaths() {
  66.         return Deaths;
  67.     }
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment