mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-18 14:47:47 +01:00
Fix IO with cache
This commit is contained in:
parent
3a2e58d18a
commit
922df85a65
@ -46,6 +46,8 @@ public class FileCache {
|
|||||||
}
|
}
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
|
|
||||||
|
if (!file.getParentFile().exists())
|
||||||
|
file.getParentFile().mkdir();
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -67,6 +69,7 @@ public class FileCache {
|
|||||||
for (int i = 0; i < inv.length; i++) {
|
for (int i = 0; i < inv.length; i++) {
|
||||||
ItemStack item = inv[i];
|
ItemStack item = inv[i];
|
||||||
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "inventory" + File.separator + i + ".cache");
|
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "inventory" + File.separator + i + ".cache");
|
||||||
|
file.createNewFile();
|
||||||
writer = new FileWriter(file);
|
writer = new FileWriter(file);
|
||||||
writer.write(item.getType().name() + API.newline);
|
writer.write(item.getType().name() + API.newline);
|
||||||
writer.write(item.getDurability() + API.newline);
|
writer.write(item.getDurability() + API.newline);
|
||||||
@ -111,6 +114,7 @@ public class FileCache {
|
|||||||
for (int i = 0; i < armors.length; i++) {
|
for (int i = 0; i < armors.length; i++) {
|
||||||
ItemStack item = armors[i];
|
ItemStack item = armors[i];
|
||||||
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "armours" + File.separator + i + ".cache");
|
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "armours" + File.separator + i + ".cache");
|
||||||
|
file.createNewFile();
|
||||||
writer = new FileWriter(file);
|
writer = new FileWriter(file);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
writer.write(item.getType().name() + API.newline);
|
writer.write(item.getType().name() + API.newline);
|
||||||
|
Loading…
Reference in New Issue
Block a user