This commit is contained in:
Leijurv 2018-08-21 12:22:45 -07:00
parent 800078a75c
commit 5bc8adc777
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,7 @@ public final class CachedRegion implements ICachedChunkAccess {
if (!Files.exists(path))
Files.createDirectories(path);
System.out.println("Saving region " + x + "," + z + " to disk");
Path regionFile = getRegionFile(path, this.x, this.z);
if (!Files.exists(regionFile))
Files.createFile(regionFile);
@ -139,6 +140,8 @@ public final class CachedRegion implements ICachedChunkAccess {
if (!Files.exists(regionFile))
return;
System.out.println("Loading region " + x + "," + z + " from disk");
byte[] decompressed;
try (FileInputStream in = new FileInputStream(regionFile.toFile())) {
decompressed = GZIPUtils.decompress(in);