From 3129acfc199e9eb395dd9765cb5777c0b08bd4d5 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Mon, 5 Nov 2012 16:03:44 -0800 Subject: [PATCH] General cleanup for pull request. --- .../gmail/nossr50/config/HiddenConfig.java | 2 +- .../nossr50/listeners/WorldListener.java | 94 +------------- src/main/java/com/gmail/nossr50/mcMMO.java | 4 +- .../BlockStoreConversionMain.java | 2 +- .../BlockStoreConversionXDirectory.java | 2 +- .../BlockStoreConversionZDirectory.java | 6 +- .../{ => chunkmeta}/ChunkManager.java | 2 +- .../{ => chunkmeta}/ChunkManagerFactory.java | 2 +- .../blockmeta/{ => chunkmeta}/ChunkStore.java | 4 +- .../{ => chunkmeta}/ChunkStoreFactory.java | 2 +- .../{ => chunkmeta}/HashChunkManager.java | 118 +++++++++++++++--- .../{ => chunkmeta}/NullChunkManager.java | 2 +- .../{ => chunkmeta}/PrimitiveChunkStore.java | 3 +- ...uffer.java => mcMMOSimpleChunkBuffer.java} | 6 +- ...onFile.java => mcMMOSimpleRegionFile.java} | 8 +- src/main/resources/hidden.yml | 2 +- 16 files changed, 132 insertions(+), 127 deletions(-) rename src/main/java/com/gmail/nossr50/runnables/{ => blockstoreconversion}/BlockStoreConversionMain.java (97%) rename src/main/java/com/gmail/nossr50/runnables/{ => blockstoreconversion}/BlockStoreConversionXDirectory.java (97%) rename src/main/java/com/gmail/nossr50/runnables/{ => blockstoreconversion}/BlockStoreConversionZDirectory.java (96%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/ChunkManager.java (99%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/ChunkManagerFactory.java (87%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/ChunkStore.java (94%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/ChunkStoreFactory.java (83%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/HashChunkManager.java (66%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/NullChunkManager.java (97%) rename src/main/java/com/gmail/nossr50/util/blockmeta/{ => chunkmeta}/PrimitiveChunkStore.java (97%) rename src/main/java/org/getspout/spoutapi/chunkstore/{SimpleChunkBuffer.java => mcMMOSimpleChunkBuffer.java} (87%) rename src/main/java/org/getspout/spoutapi/chunkstore/{SimpleRegionFile.java => mcMMOSimpleRegionFile.java} (96%) diff --git a/src/main/java/com/gmail/nossr50/config/HiddenConfig.java b/src/main/java/com/gmail/nossr50/config/HiddenConfig.java index d1d4f1638..18c3644d3 100644 --- a/src/main/java/com/gmail/nossr50/config/HiddenConfig.java +++ b/src/main/java/com/gmail/nossr50/config/HiddenConfig.java @@ -28,7 +28,7 @@ public class HiddenConfig { if (mcMMO.p.getResource(fileName) != null) { config = YamlConfiguration.loadConfiguration(mcMMO.p.getResource(fileName)); chunkletsEnabled = config.getBoolean("Options.Chunklets", true); - conversionRate = config.getInt("Options.ConversionRate", 1); + conversionRate = config.getInt("Options.ConversionRate", 3); } } diff --git a/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index 7e741c6de..1b1c27bfc 100644 --- a/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -13,13 +13,8 @@ import org.bukkit.event.world.WorldUnloadEvent; import org.bukkit.World; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.runnables.BlockStoreConversionMain; -import com.gmail.nossr50.util.blockmeta.ChunkletStore; -import com.gmail.nossr50.util.blockmeta.PrimitiveChunkletStore; -import com.gmail.nossr50.util.blockmeta.PrimitiveExChunkletStore; -import com.gmail.nossr50.util.blockmeta.PrimitiveChunkStore; -import com.gmail.nossr50.util.blockmeta.HashChunkletManager; -import com.gmail.nossr50.util.blockmeta.HashChunkManager; +import com.gmail.nossr50.runnables.blockstoreconversion.BlockStoreConversionMain; +import com.gmail.nossr50.util.blockmeta.chunkmeta.HashChunkManager; public class WorldListener implements Listener { ArrayList converters = new ArrayList(); @@ -66,90 +61,7 @@ public class WorldListener implements Listener { World world = event.getChunk().getWorld(); int cx = event.getChunk().getX(); int cz = event.getChunk().getZ(); - HashChunkletManager manager = new HashChunkletManager(); - HashChunkManager newManager = (HashChunkManager) mcMMO.p.placeStore; - manager.loadChunk(cx, cz, world); - - for(int y = 0; y < (world.getMaxHeight() / 64); y++) { - String chunkletName = world.getName() + "," + cx + "," + cz + "," + y; - ChunkletStore tempChunklet = manager.store.get(chunkletName); - PrimitiveChunkletStore primitiveChunklet = null; - PrimitiveExChunkletStore primitiveExChunklet = null; - if(tempChunklet instanceof PrimitiveChunkletStore) - primitiveChunklet = (PrimitiveChunkletStore) tempChunklet; - else if(tempChunklet instanceof PrimitiveExChunkletStore) - primitiveExChunklet = (PrimitiveExChunkletStore) tempChunklet; - if(tempChunklet == null) { - continue; - } else { - String chunkName = world.getName() + "," + cx + "," + cz; - PrimitiveChunkStore cChunk = (PrimitiveChunkStore) newManager.store.get(chunkName); - - if(cChunk != null) { - int xPos = cx * 16; - int zPos = cz * 16; - - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - int cxPos = xPos + x; - int czPos = zPos + z; - - for(int y2 = (64 * y); y2 < (64 * y + 64); y2++) { - if(!manager.isTrue(cxPos, y2, czPos, world)) - continue; - - newManager.setTrue(cxPos, y2, czPos, world); - } - } - } - continue; - } - - newManager.setTrue(cx * 16, 0, cz * 16, world); - newManager.setFalse(cx * 16, 0, cz * 16, world); - cChunk = (PrimitiveChunkStore) newManager.store.get(chunkName); - - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - boolean[] oldArray; - if(primitiveChunklet != null) - oldArray = primitiveChunklet.store[x][z]; - if(primitiveExChunklet != null) - oldArray = primitiveExChunklet.store[x][z]; - else - return; - boolean[] newArray = cChunk.store[x][z]; - if(oldArray.length < 64) - return; - else if(newArray.length < ((y * 64) + 64)) - return; - System.arraycopy(oldArray, 0, newArray, (y * 64), 64); - } - } - } - } - - manager.unloadChunk(cx, cz, world); - newManager.unloadChunk(cx, cz, world); - - File cxDir = new File(dataDir, "" + cx); - if(!cxDir.exists()) return; - File czDir = new File(cxDir, "" + cz); - if(!czDir.exists()) return; - - for(File yFile : czDir.listFiles()) { - if(!yFile.exists()) - continue; - - yFile.delete(); - } - - if(czDir.listFiles().length <= 0) - czDir.delete(); - if(cxDir.listFiles().length <= 0) - cxDir.delete(); - if(dataDir.listFiles().length <= 0) - dataDir.delete(); + ((HashChunkManager) mcMMO.p.placeStore).convertChunk(dataDir, cx, cz, world); } } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 630ed95b0..7286b9dd5 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -79,8 +79,8 @@ import com.gmail.nossr50.util.Leaderboard; import com.gmail.nossr50.util.Metrics; import com.gmail.nossr50.util.Metrics.Graph; import com.gmail.nossr50.util.Users; -import com.gmail.nossr50.util.blockmeta.ChunkManager; -import com.gmail.nossr50.util.blockmeta.ChunkManagerFactory; +import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManager; +import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManagerFactory; public class mcMMO extends JavaPlugin { diff --git a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionMain.java b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionMain.java similarity index 97% rename from src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionMain.java rename to src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionMain.java index abbbe34cf..c4b421750 100755 --- a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionMain.java +++ b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionMain.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.runnables.blockstoreconversion; import java.io.File; import java.lang.Runnable; diff --git a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionXDirectory.java b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionXDirectory.java similarity index 97% rename from src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionXDirectory.java rename to src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionXDirectory.java index 87570296b..da8a7e07d 100755 --- a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionXDirectory.java +++ b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionXDirectory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.runnables.blockstoreconversion; import java.io.File; import java.lang.Runnable; diff --git a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionZDirectory.java b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionZDirectory.java similarity index 96% rename from src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionZDirectory.java rename to src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionZDirectory.java index ad528b03f..5b7bcfa01 100755 --- a/src/main/java/com/gmail/nossr50/runnables/BlockStoreConversionZDirectory.java +++ b/src/main/java/com/gmail/nossr50/runnables/blockstoreconversion/BlockStoreConversionZDirectory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.runnables; +package com.gmail.nossr50.runnables.blockstoreconversion; import java.io.File; import java.lang.Runnable; @@ -10,9 +10,9 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.blockmeta.ChunkletStore; import com.gmail.nossr50.util.blockmeta.PrimitiveChunkletStore; import com.gmail.nossr50.util.blockmeta.PrimitiveExChunkletStore; -import com.gmail.nossr50.util.blockmeta.PrimitiveChunkStore; +import com.gmail.nossr50.util.blockmeta.chunkmeta.PrimitiveChunkStore; import com.gmail.nossr50.util.blockmeta.HashChunkletManager; -import com.gmail.nossr50.util.blockmeta.HashChunkManager; +import com.gmail.nossr50.util.blockmeta.chunkmeta.HashChunkManager; public class BlockStoreConversionZDirectory implements Runnable { private int taskID, cx, cz, x, y, z, y2, xPos, zPos, cxPos, czPos; diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java similarity index 99% rename from src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManager.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java index 7bc86cfb8..528e6668a 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import java.io.IOException; diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManagerFactory.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java similarity index 87% rename from src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManagerFactory.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java index b0a548ec8..a18731c4c 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkManagerFactory.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkManagerFactory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import com.gmail.nossr50.config.HiddenConfig; diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStore.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java similarity index 94% rename from src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStore.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java index b40f21c6b..fbc331231 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStore.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStore.java @@ -1,7 +1,9 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import java.io.Serializable; +import com.gmail.nossr50.util.blockmeta.ChunkletStore; + /** * A ChunkStore should be responsible for a 16x16xWorldHeight area of data */ diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStoreFactory.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java similarity index 83% rename from src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStoreFactory.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java index 7a8a33c7e..2ca5d5032 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/ChunkStoreFactory.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/ChunkStoreFactory.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import org.bukkit.World; diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java similarity index 66% rename from src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkManager.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java index 33cc5216a..3faef4be7 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import java.io.File; import java.io.InputStream; @@ -17,20 +17,24 @@ import org.bukkit.block.Block; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.ChunkletUnloader; +import com.gmail.nossr50.util.blockmeta.ChunkletStore; +import com.gmail.nossr50.util.blockmeta.PrimitiveChunkletStore; +import com.gmail.nossr50.util.blockmeta.PrimitiveExChunkletStore; +import com.gmail.nossr50.util.blockmeta.HashChunkletManager; -import org.getspout.spoutapi.chunkstore.SimpleRegionFile; +import org.getspout.spoutapi.chunkstore.mcMMOSimpleRegionFile; public class HashChunkManager implements ChunkManager { - private HashMap> regionFiles = new HashMap>(); + private HashMap> regionFiles = new HashMap>(); public HashMap store = new HashMap(); @Override public void closeAll() { for (UUID uid : regionFiles.keySet()) { - HashMap worldRegions = regionFiles.get(uid); - Iterator itr = worldRegions.values().iterator(); + HashMap worldRegions = regionFiles.get(uid); + Iterator itr = worldRegions.values().iterator(); while (itr.hasNext()) { - SimpleRegionFile rf = itr.next(); + mcMMOSimpleRegionFile rf = itr.next(); if (rf != null) { rf.close(); itr.remove(); @@ -42,7 +46,7 @@ public class HashChunkManager implements ChunkManager { @Override public ChunkStore readChunkStore(World world, int x, int z) throws IOException { - SimpleRegionFile rf = getSimpleRegionFile(world, x, z); + mcMMOSimpleRegionFile rf = getSimpleRegionFile(world, x, z); InputStream in = rf.getInputStream(x, z); if (in == null) { return null; @@ -73,7 +77,7 @@ public class HashChunkManager implements ChunkManager { return; } try { - SimpleRegionFile rf = getSimpleRegionFile(world, x, z); + mcMMOSimpleRegionFile rf = getSimpleRegionFile(world, x, z); ObjectOutputStream objectStream = new ObjectOutputStream(rf.getOutputStream(x, z)); objectStream.writeObject(data); objectStream.flush(); @@ -86,23 +90,23 @@ public class HashChunkManager implements ChunkManager { @Override public void closeChunkStore(World world, int x, int z) { - SimpleRegionFile rf = getSimpleRegionFile(world, x, z); + mcMMOSimpleRegionFile rf = getSimpleRegionFile(world, x, z); if (rf != null) { rf.close(); } } - private SimpleRegionFile getSimpleRegionFile(World world, int x, int z) { + private mcMMOSimpleRegionFile getSimpleRegionFile(World world, int x, int z) { File directory = new File(world.getWorldFolder(), "mcmmo_regions"); directory.mkdirs(); UUID key = world.getUID(); - HashMap worldRegions = regionFiles.get(key); + HashMap worldRegions = regionFiles.get(key); if (worldRegions == null) { - worldRegions = new HashMap(); + worldRegions = new HashMap(); regionFiles.put(key, worldRegions); } @@ -111,11 +115,11 @@ public class HashChunkManager implements ChunkManager { long key2 = (((long) rx) << 32) | (((long) rz) & 0xFFFFFFFFL); - SimpleRegionFile regionFile = worldRegions.get(key2); + mcMMOSimpleRegionFile regionFile = worldRegions.get(key2); if (regionFile == null) { File file = new File(directory, "mcmmo_" + rx + "_" + rz + "_.mcm"); - regionFile = new SimpleRegionFile(file, rx, rz); + regionFile = new mcMMOSimpleRegionFile(file, rx, rz); worldRegions.put(key2, regionFile); } @@ -371,4 +375,90 @@ public class HashChunkManager implements ChunkManager { @Override public void cleanUp() {} + + public void convertChunk(File dataDir, int cx, int cz, World world) { + HashChunkletManager manager = new HashChunkletManager(); + manager.loadChunk(cx, cz, world); + + for(int y = 0; y < (world.getMaxHeight() / 64); y++) { + String chunkletName = world.getName() + "," + cx + "," + cz + "," + y; + ChunkletStore tempChunklet = manager.store.get(chunkletName); + PrimitiveChunkletStore primitiveChunklet = null; + PrimitiveExChunkletStore primitiveExChunklet = null; + if(tempChunklet instanceof PrimitiveChunkletStore) + primitiveChunklet = (PrimitiveChunkletStore) tempChunklet; + else if(tempChunklet instanceof PrimitiveExChunkletStore) + primitiveExChunklet = (PrimitiveExChunkletStore) tempChunklet; + if(tempChunklet == null) { + continue; + } else { + String chunkName = world.getName() + "," + cx + "," + cz; + PrimitiveChunkStore cChunk = (PrimitiveChunkStore) store.get(chunkName); + + if(cChunk != null) { + int xPos = cx * 16; + int zPos = cz * 16; + + for(int x = 0; x < 16; x++) { + for(int z = 0; z < 16; z++) { + int cxPos = xPos + x; + int czPos = zPos + z; + + for(int y2 = (64 * y); y2 < (64 * y + 64); y2++) { + if(!manager.isTrue(cxPos, y2, czPos, world)) + continue; + + setTrue(cxPos, y2, czPos, world); + } + } + } + continue; + } + + setTrue(cx * 16, 0, cz * 16, world); + setFalse(cx * 16, 0, cz * 16, world); + cChunk = (PrimitiveChunkStore) store.get(chunkName); + + for(int x = 0; x < 16; x++) { + for(int z = 0; z < 16; z++) { + boolean[] oldArray; + if(primitiveChunklet != null) + oldArray = primitiveChunklet.store[x][z]; + if(primitiveExChunklet != null) + oldArray = primitiveExChunklet.store[x][z]; + else + return; + boolean[] newArray = cChunk.store[x][z]; + if(oldArray.length < 64) + return; + else if(newArray.length < ((y * 64) + 64)) + return; + System.arraycopy(oldArray, 0, newArray, (y * 64), 64); + } + } + } + } + + manager.unloadChunk(cx, cz, world); + unloadChunk(cx, cz, world); + + File cxDir = new File(dataDir, "" + cx); + if(!cxDir.exists()) return; + File czDir = new File(cxDir, "" + cz); + if(!czDir.exists()) return; + + for(File yFile : czDir.listFiles()) { + if(!yFile.exists()) + continue; + + yFile.delete(); + } + + if(czDir.listFiles().length <= 0) + czDir.delete(); + if(cxDir.listFiles().length <= 0) + cxDir.delete(); + if(dataDir.listFiles().length <= 0) + dataDir.delete(); + } } diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java similarity index 97% rename from src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkManager.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java index b104e14ee..e1cf4b574 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/NullChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/NullChunkManager.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import java.io.IOException; diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkStore.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java similarity index 97% rename from src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkStore.java rename to src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java index 0a22b308b..3e08fb624 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/PrimitiveChunkStore.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -1,4 +1,4 @@ -package com.gmail.nossr50.util.blockmeta; +package com.gmail.nossr50.util.blockmeta.chunkmeta; import java.io.IOException; import java.io.ObjectInputStream; @@ -8,6 +8,7 @@ import java.util.UUID; import org.bukkit.World; import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.blockmeta.ChunkletStore; public class PrimitiveChunkStore implements ChunkStore { private static final long serialVersionUID = -1L; diff --git a/src/main/java/org/getspout/spoutapi/chunkstore/SimpleChunkBuffer.java b/src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleChunkBuffer.java similarity index 87% rename from src/main/java/org/getspout/spoutapi/chunkstore/SimpleChunkBuffer.java rename to src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleChunkBuffer.java index db8ef6fe2..4da4a4b5a 100755 --- a/src/main/java/org/getspout/spoutapi/chunkstore/SimpleChunkBuffer.java +++ b/src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleChunkBuffer.java @@ -22,11 +22,11 @@ package org.getspout.spoutapi.chunkstore; import java.io.ByteArrayOutputStream; import java.io.IOException; -public class SimpleChunkBuffer extends ByteArrayOutputStream { - final SimpleRegionFile rf; +public class mcMMOSimpleChunkBuffer extends ByteArrayOutputStream { + final mcMMOSimpleRegionFile rf; final int index; - SimpleChunkBuffer(SimpleRegionFile rf, int index) { + mcMMOSimpleChunkBuffer(mcMMOSimpleRegionFile rf, int index) { super(1024); this.rf = rf; this.index = index; diff --git a/src/main/java/org/getspout/spoutapi/chunkstore/SimpleRegionFile.java b/src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleRegionFile.java similarity index 96% rename from src/main/java/org/getspout/spoutapi/chunkstore/SimpleRegionFile.java rename to src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleRegionFile.java index 0e8ea2173..8acd53434 100755 --- a/src/main/java/org/getspout/spoutapi/chunkstore/SimpleRegionFile.java +++ b/src/main/java/org/getspout/spoutapi/chunkstore/mcMMOSimpleRegionFile.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; -public class SimpleRegionFile { +public class mcMMOSimpleRegionFile { private RandomAccessFile file; private final int[] dataStart = new int[1024]; private final int[] dataActualLength = new int[1024]; @@ -46,11 +46,11 @@ public class SimpleRegionFile { @SuppressWarnings("unused") private static long TIMEOUT_TIME = 300000; // 5 min - public SimpleRegionFile(File f, int rx, int rz) { + public mcMMOSimpleRegionFile(File f, int rx, int rz) { this(f, rx, rz, 10); } - public SimpleRegionFile(File f, int rx, int rz, int defaultSegmentSize) { + public mcMMOSimpleRegionFile(File f, int rx, int rz, int defaultSegmentSize) { this.rx = rx; this.rz = rz; this.defaultSegmentSize = defaultSegmentSize; @@ -160,7 +160,7 @@ public class SimpleRegionFile { public DataOutputStream getOutputStream(int x, int z) { int index = getChunkIndex(x, z); - return new DataOutputStream(new DeflaterOutputStream(new SimpleChunkBuffer(this, index))); + return new DataOutputStream(new DeflaterOutputStream(new mcMMOSimpleChunkBuffer(this, index))); } public DataInputStream getInputStream(int x, int z) throws IOException { diff --git a/src/main/resources/hidden.yml b/src/main/resources/hidden.yml index 175985949..468ae99f5 100644 --- a/src/main/resources/hidden.yml +++ b/src/main/resources/hidden.yml @@ -6,4 +6,4 @@ Options: # true to use Chunklets metadata store system, false to disable Chunklets: true # Square root of the number of chunks to convert per tick. - ConversionRate: 1 \ No newline at end of file + ConversionRate: 3 \ No newline at end of file