diff options
author | feildmaster <admin@feildmaster.com> | 2012-04-24 13:30:55 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-04-24 15:06:11 -0500 |
commit | 0220c1ff746cd721c14fa1b09836addc26742e14 (patch) | |
tree | 8898657f4d6fb7ddc78c4c49d18f5ff39af53272 /src/main/java/org | |
parent | 119b5d18a5c59d490bf0872fac95bcd4ec6dfd54 (diff) | |
download | craftbukkit-0220c1ff746cd721c14fa1b09836addc26742e14.tar craftbukkit-0220c1ff746cd721c14fa1b09836addc26742e14.tar.gz craftbukkit-0220c1ff746cd721c14fa1b09836addc26742e14.tar.lz craftbukkit-0220c1ff746cd721c14fa1b09836addc26742e14.tar.xz craftbukkit-0220c1ff746cd721c14fa1b09836addc26742e14.zip |
Remove legacy Chunk cache. Fixes BUKKIT-1400
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 8603f9e2..5bc8eb68 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1,22 +1,19 @@ package org.bukkit.craftbukkit; -import com.google.common.collect.MapMaker; import java.io.File; import java.util.Set; -import org.apache.commons.lang.Validate; - -import org.bukkit.craftbukkit.entity.*; -import org.bukkit.craftbukkit.metadata.BlockMetadataStore; -import org.bukkit.entity.*; -import org.bukkit.entity.Entity; - import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; -import java.util.concurrent.ConcurrentMap; import java.util.List; import java.util.Random; import java.util.UUID; +import org.apache.commons.lang.Validate; + +import org.bukkit.craftbukkit.entity.*; +import org.bukkit.craftbukkit.metadata.BlockMetadataStore; +import org.bukkit.entity.*; +import org.bukkit.entity.Entity; import net.minecraft.server.*; @@ -52,7 +49,6 @@ public class CraftWorld implements World { private final WorldServer world; private Environment environment; private final CraftServer server = (CraftServer) Bukkit.getServer(); - private ConcurrentMap<Integer, CraftChunk> unloadedChunks = new MapMaker().weakValues().makeMap(); private final ChunkGenerator generator; private final List<BlockPopulator> populators = new ArrayList<BlockPopulator>(); private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this); @@ -69,15 +65,6 @@ public class CraftWorld implements World { environment = env; } - public void preserveChunk(CraftChunk chunk) { - chunk.breakLink(); - unloadedChunks.put((chunk.getX() << 16) + chunk.getZ(), chunk); - } - - public Chunk popPreservedChunk(int x, int z) { - return unloadedChunks.remove((x << 16) + z); - } - public Block getBlockAt(int x, int y, int z) { return getChunkAt(x >> 4, z >> 4).getBlock(x & 0xF, y & 0xFF, z & 0xF); } @@ -181,7 +168,6 @@ public class CraftWorld implements World { world.chunkProviderServer.saveChunkNOP(chunk); } - preserveChunk((CraftChunk) chunk.bukkitChunk); world.chunkProviderServer.unloadQueue.remove(x, z); world.chunkProviderServer.chunks.remove(x, z); world.chunkProviderServer.chunkList.remove(chunk); |