Use buffered streams when managing NBT files

This commit is contained in:
Chicken-Bones committed 2014-10-01 20:01:10 +10:00
1 parent 8d1619589d
commit f2180dfab5
7 files changed
+51 -47

No files matched your search

+3 -4
View File
@@ -55,9 +55,8 @@ public class NEIServerConfig
private static void loadWorld(World world) {
try {
File file = new File(getSaveDir(CommonUtils.getDimension(world)), "world.dat");
NBTTagCompound tag = CompressedStreamTools.read(file);
if(tag == null)
tag = new NBTTagCompound();
NBTTagCompound tag = NEIServerUtils.readNBT(file);
if(tag == null) tag = new NBTTagCompound();
dimTags.put(CommonUtils.getDimension(world), tag);
} catch (Exception e) {
throw new RuntimeException(e);
@@ -103,7 +102,7 @@ public class NEIServerConfig
private static void saveWorld(int dim) {
try {
File file = new File(getSaveDir(dim), "world.dat");
CompressedStreamTools.write(dimTags.get(dim), file);
NEIServerUtils.writeNBT(dimTags.get(dim), file);
} catch (Exception e) {
throw new RuntimeException(e);
}