Fixes
This commit is contained in:
+19
-16
@@ -45,9 +45,9 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||
|
||||
@@ -198,9 +198,9 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
try {
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||
@@ -537,22 +537,25 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
try {
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
||||
if (!file.exists()) {
|
||||
file = new File("cache/" + player.getName().toLowerCase() + ".cache");
|
||||
}
|
||||
if (file.exists()) {
|
||||
if (file.isDirectory() && file.listFiles() != null) {
|
||||
Utils.purgeDirectory(file);
|
||||
} else file.delete();
|
||||
if (file.list() != null) {
|
||||
Utils.purgeDirectory(file);
|
||||
file.delete();
|
||||
} else {
|
||||
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + player.getName().toLowerCase() + ".cache");
|
||||
if(file.isFile()){
|
||||
file.delete();
|
||||
} else {
|
||||
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache, it doesn't exist!");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.showError("File cannot be removed correctly :/");
|
||||
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache :/");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,9 +564,9 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||
if (!file.exists()) {
|
||||
|
||||
Reference in New Issue
Block a user