From 6da43b15c8af229c13179cc361914091ee243670 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Fri, 18 May 2012 03:14:19 -0400 Subject: [PATCH] Move to a more ideal location. Not as efficient as I would like, but certainly better than it was before --- .../nossr50/util/blockmeta/HashChunkletManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java index fefef7940..7e8e696df 100644 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java @@ -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);