#575 Hotfix for reload support

- Create temporary method for reloading any stateful entities -> a lot of duplicated code, to be fixed soon within #432
- Remove unused methods
This commit is contained in:
ljacqu
2016-03-05 22:30:35 +01:00
parent 83dd1cf4a3
commit 98df21d75a
11 changed files with 88 additions and 84 deletions
@@ -35,29 +35,6 @@ public class JsonCache {
.create();
}
public void createCache(Player player, PlayerData playerData) {
if (player == null) {
return;
}
String name = player.getName().toLowerCase();
File file = new File(cacheDir, name + File.separator + "cache.json");
if (file.exists()) {
return;
}
if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
return;
}
try {
String data = gson.toJson(playerData);
Files.touch(file);
Files.write(data, file, Charsets.UTF_8);
} catch (IOException e) {
ConsoleLogger.writeStackTrace(e);
}
}
public PlayerData readCache(Player player) {
String name = player.getName().toLowerCase();
File file = new File(cacheDir, name + File.separator + "cache.json");