2
0

DatabaseAPI.java 837 B

123456789101112131415161718192021222324252627282930
  1. package com.gmail.nossr50.api;
  2. import com.gmail.nossr50.datatypes.player.PlayerProfile;
  3. import com.gmail.nossr50.mcMMO;
  4. import java.util.UUID;
  5. public class DatabaseAPI {
  6. /**
  7. * Checks if a player exists in the mcMMO Database
  8. * @param uuid player UUID
  9. * @return true if the player exists in the DB, false if they do not
  10. */
  11. public boolean doesPlayerExistInDB(String uuid) {
  12. return doesPlayerExistInDB(UUID.fromString(uuid));
  13. }
  14. /**
  15. * Checks if a player exists in the mcMMO Database
  16. * @param uuid player UUID
  17. * @return true if the player exists in the DB, false if they do not
  18. */
  19. public boolean doesPlayerExistInDB(UUID uuid) {
  20. PlayerProfile playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
  21. return playerProfile.isLoaded();
  22. }
  23. }