Material.AIR create a bug ?

This commit is contained in:
Xephi 2014-08-28 17:31:03 +02:00
parent 23128b9c02
commit 28001db6bf

View File

@ -71,6 +71,11 @@ public class FileCache {
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(); file.createNewFile();
writer = new FileWriter(file); writer = new FileWriter(file);
if (item.getType() == Material.AIR) {
writer.write("AIR");
writer.close();
continue;
}
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);
writer.write(item.getAmount() + API.newline); writer.write(item.getAmount() + API.newline);
@ -117,6 +122,11 @@ public class FileCache {
file.createNewFile(); file.createNewFile();
writer = new FileWriter(file); writer = new FileWriter(file);
if (item != null) { if (item != null) {
if (item.getType() == Material.AIR) {
writer.write("AIR");
writer.close();
continue;
}
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);
writer.write(item.getAmount() + API.newline); writer.write(item.getAmount() + API.newline);