public NBTFile(File file) throws IOException { super(null, null); this.file = file; if (file.exists()) { FileInputStream inputsteam = new FileInputStream(file); nbt = NBTReflectionUtil.readNBTFile(inputsteam); } else { nbt = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance(); save(); } }
file.setLong("time", System.currentTimeMillis()); file.setString("test", "test"); file.save(); file = null; file = new NBTFile(new File(getDataFolder(), "test.nbt"));