mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Use buffered streams when managing NBT files
This commit is contained in:
1 parent
8d1619589d
commit
f2180dfab5
7 files changed
+51
-47
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user