mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
[Bleeding] Remove redundant chunkList from ChunkProviderServer
This ArrayList duplicates part of the functionality of the much more efficient chunk map so can be removed as the map can be used in the few places this was needed.
This commit is contained in:
committed by
Travis Watkins
parent
97ac0a3f14
commit
627cf2ef8b
@@ -25,7 +25,6 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
private IChunkLoader e;
|
||||
public boolean forceChunkLoad = false; // true -> false
|
||||
public LongObjectHashMap<Chunk> chunks = new LongObjectHashMap<Chunk>();
|
||||
public List chunkList = new ArrayList();
|
||||
public WorldServer world;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -70,7 +69,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
|
||||
public void a() {
|
||||
Iterator iterator = this.chunkList.iterator();
|
||||
Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Chunk chunk = (Chunk) iterator.next();
|
||||
@@ -98,7 +97,6 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
|
||||
this.chunks.put(i, j, chunk); // CraftBukkit
|
||||
this.chunkList.add(chunk);
|
||||
if (chunk != null) {
|
||||
chunk.addEntities();
|
||||
}
|
||||
@@ -216,7 +214,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
||||
public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate) {
|
||||
int i = 0;
|
||||
Iterator iterator = this.chunkList.iterator();
|
||||
Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Chunk chunk = (Chunk) iterator.next();
|
||||
@@ -263,7 +261,6 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
this.saveChunkNOP(chunk);
|
||||
// this.unloadQueue.remove(integer);
|
||||
this.chunks.remove(chunkcoordinates); // CraftBukkit
|
||||
this.chunkList.remove(chunk);
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
Reference in New Issue
Block a user