Skip to content

Commit

Permalink
Fix minor issues with FLAT
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Apr 30, 2023
1 parent b914b86 commit 57b40ee
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ public ArrayList<String> getKeys(boolean waitForCache) {
return keys;
}

@SuppressWarnings("deprecation")
public ArrayList<String> getKeys(UserStorage storage, boolean waitForCache) {
ArrayList<String> keys = new ArrayList<String>();
if (storage.equals(UserStorage.MYSQL)) {
if (storage.equals(UserStorage.FLAT)) {
keys = new ArrayList<String>(getData(user.getUUID()).getConfigurationSection("").getKeys(false));
} else if (storage.equals(UserStorage.MYSQL)) {
List<Column> col = getMySqlRow();
if (col != null && !col.isEmpty()) {
for (Column c : col) {
Expand Down Expand Up @@ -395,11 +398,14 @@ private void setData(final String uuid, final String path, final Object value) {
FileThread.getInstance().getThread().setData(this, uuid, path, value);
}

@SuppressWarnings("deprecation")
public void remove() {
if (user.getPlugin().getStorageType().equals(UserStorage.MYSQL)) {
user.getPlugin().getMysql().deletePlayer(user.getUUID());
} else if (user.getPlugin().getStorageType().equals(UserStorage.SQLITE)) {
user.getPlugin().getSQLiteUserTable().delete(new Column("uuid", new DataValueString(user.getUUID())));
} else if (user.getPlugin().getStorageType().equals(UserStorage.FLAT)) {
FileThread.getInstance().getThread().deletePlayerFile(user.getUUID());
}
user.clearCache();
}
Expand Down

0 comments on commit 57b40ee

Please sign in to comment.