Changed block cache to soft references (should help a lot with memory usage)

This commit is contained in:
Dinnerbone
2011-03-09 22:12:28 +00:00
parent 507e2be8ea
commit 0df1d1a101
2 changed files with 202 additions and 1 deletions

View File

@@ -10,10 +10,11 @@ import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.block.CraftBlock;
import org.bukkit.craftbukkit.util.SoftMap;
public class CraftChunk implements Chunk {
private WeakReference<net.minecraft.server.Chunk> weakChunk;
private final HashMap<Integer, Block> cache = new HashMap<Integer, Block>();
private final SoftMap<Integer, Block> cache = new SoftMap<Integer, Block>();
private WorldServer worldServer;
private int x;
private int z;