Move to a more ideal location.

Not as efficient as I would like, but certainly better than it was before
This commit is contained in:
NuclearW 2012-05-18 03:14:19 -04:00
parent d0bb7b075e
commit 6da43b15c8

View File

@ -37,14 +37,15 @@ public class HashChunkletManager implements ChunkletManager {
public void chunkUnloaded(int cx, int cz, World world) {
File dataDir = new File(world.getWorldFolder(), "mcmmo_data");
File cxDir = new File(dataDir, "" + cx);
if(!cxDir.exists()) cxDir.mkdir();
File czDir = new File(cxDir, "" + cz);
if(!czDir.exists()) czDir.mkdir();
for(int y = 1; y <= 4; y++) {
File yFile = new File(czDir, "" + y);
if(store.containsKey(world.getName() + "," + cx + "," + cz + "," + y)) {
File cxDir = new File(dataDir, "" + cx);
if(!cxDir.exists()) cxDir.mkdir();
File czDir = new File(cxDir, "" + cz);
if(!czDir.exists()) czDir.mkdir();
File yFile = new File(czDir, "" + y);
ChunkletStore out = store.get(world.getName() + "," + cx + "," + cz + "," + y);
serializeChunkletStore(out, yFile);
store.remove(world.getName() + "," + cx + "," + cz + "," + y);