From 00a5bc5cf3084f37dead3452d0ffb5e5354ca8dd Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Mon, 5 Nov 2012 19:48:41 -0800 Subject: [PATCH] Fixing lag caused by conversion. --- .../util/blockmeta/chunkmeta/HashChunkManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java index d0d8f8615..225725dca 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java @@ -149,6 +149,10 @@ public class HashChunkManager implements ChunkManager { ChunkStore in = null; + File dataDir = new File(world.getWorldFolder(), "mcmmo_data"); + if(dataDir.exists()) + convertChunk(dataDir, cx, cz, world, true); + try { in = readChunkStore(world, cx, cz); } @@ -380,6 +384,12 @@ public class HashChunkManager implements ChunkManager { public synchronized void cleanUp() {} public synchronized void convertChunk(File dataDir, int cx, int cz, World world) { + convertChunk(dataDir, cx, cz, world, false); + } + + public synchronized void convertChunk(File dataDir, int cx, int cz, World world, boolean actually) { + if(!actually) + return; if(!dataDir.exists()) return; File cxDir = new File(dataDir, "" + cx); if(!cxDir.exists()) return;