save regularly

This commit is contained in:
Leijurv 2018-08-23 13:42:45 -07:00
parent 14df84ef0e
commit cacd2096ec
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -66,6 +66,21 @@ public final class CachedWorld implements IBlockTypeAccess {
// Insert an invalid region element
cachedRegions.put(0, null);
new PackerThread().start();
new Thread() {
public void run() {
try {
while (true) {
// since a region only saves if it's been modified since its last save
// saving every 10 minutes means that once it's time to exit
// we'll only have a couple regions to save
save();
Thread.sleep(600000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}
public final void queueForPacking(Chunk chunk) {