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

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot
2011-03-09 22:12:28 +00:00
parent 57d31f1940
commit 88de992943
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;