Fixed the wrong cache directory being used.

This commit is contained in:
Matthew Miller 2018-12-10 11:39:03 +10:00
parent 6dbd731c92
commit 80aec378d8
2 changed files with 3 additions and 4 deletions

View File

@ -75,7 +75,7 @@ public void setup() {
cacheDir.mkdirs();
try {
profileCache = new SQLiteCache(new File(getPlatform().getConfigDir().toFile(), "profiles.sqlite"));
profileCache = new SQLiteCache(new File(cacheDir, "profiles.sqlite"));
} catch (IOException e) {
WorldGuard.logger.log(Level.WARNING, "Failed to initialize SQLite profile cache");
profileCache = new HashMapCache();

View File

@ -267,10 +267,9 @@ public String toPlayersString() {
return toPlayersString(null);
}
@SuppressWarnings("deprecation")
public String toPlayersString(@Nullable ProfileCache cache) {
StringBuilder str = new StringBuilder();
List<String> output = new ArrayList<String>();
List<String> output = new ArrayList<>();
for (String name : playerDomain.getPlayers()) {
output.add("name:" + name);
@ -292,7 +291,7 @@ public String toPlayersString(@Nullable ProfileCache cache) {
}
}
Collections.sort(output, String.CASE_INSENSITIVE_ORDER);
output.sort(String.CASE_INSENSITIVE_ORDER);
for (Iterator<String> it = output.iterator(); it.hasNext();) {
str.append(it.next());
if (it.hasNext()) {