Skip to content

Commit 57b40ee

Browse files
committed
Fix minor issues with FLAT
1 parent b914b86 commit 57b40ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

AdvancedCore/src/com/bencodez/advancedcore/api/user/UserData.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,12 @@ public ArrayList<String> getKeys(boolean waitForCache) {
207207
return keys;
208208
}
209209

210+
@SuppressWarnings("deprecation")
210211
public ArrayList<String> getKeys(UserStorage storage, boolean waitForCache) {
211212
ArrayList<String> keys = new ArrayList<String>();
212-
if (storage.equals(UserStorage.MYSQL)) {
213+
if (storage.equals(UserStorage.FLAT)) {
214+
keys = new ArrayList<String>(getData(user.getUUID()).getConfigurationSection("").getKeys(false));
215+
} else if (storage.equals(UserStorage.MYSQL)) {
213216
List<Column> col = getMySqlRow();
214217
if (col != null && !col.isEmpty()) {
215218
for (Column c : col) {
@@ -395,11 +398,14 @@ private void setData(final String uuid, final String path, final Object value) {
395398
FileThread.getInstance().getThread().setData(this, uuid, path, value);
396399
}
397400

401+
@SuppressWarnings("deprecation")
398402
public void remove() {
399403
if (user.getPlugin().getStorageType().equals(UserStorage.MYSQL)) {
400404
user.getPlugin().getMysql().deletePlayer(user.getUUID());
401405
} else if (user.getPlugin().getStorageType().equals(UserStorage.SQLITE)) {
402406
user.getPlugin().getSQLiteUserTable().delete(new Column("uuid", new DataValueString(user.getUUID())));
407+
} else if (user.getPlugin().getStorageType().equals(UserStorage.FLAT)) {
408+
FileThread.getInstance().getThread().deletePlayerFile(user.getUUID());
403409
}
404410
user.clearCache();
405411
}

0 commit comments

Comments
 (0)