mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 18:24:43 +02:00
Add new DatabaseAPI
This commit is contained in:
33
src/main/java/com/gmail/nossr50/api/DatabaseAPI.java
Normal file
33
src/main/java/com/gmail/nossr50/api/DatabaseAPI.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class DatabaseAPI {
|
||||
|
||||
/**
|
||||
* Checks if a player exists in the mcMMO Database
|
||||
* @param uuid player UUID
|
||||
* @return true if the player exists in the DB, false if they do not
|
||||
*/
|
||||
public boolean doesPlayerExistInDB(String uuid) {
|
||||
return doesPlayerExistInDB(UUID.fromString(uuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a player exists in the mcMMO Database
|
||||
* @param uuid player UUID
|
||||
* @return true if the player exists in the DB, false if they do not
|
||||
*/
|
||||
public boolean doesPlayerExistInDB(UUID uuid) {
|
||||
PlayerProfile playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
|
||||
|
||||
if(playerProfile.isLoaded())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user