mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-26 04:25:31 +01:00
Optimize chunk filter a little
This commit is contained in:
parent
7f0df85b6f
commit
d97560cc82
@ -282,24 +282,26 @@ public Collection<Vector2i> getChunkList(long modifiedSinceMillis, Predicate<Vec
|
|||||||
|
|
||||||
for (int x = 0; x < 32; x++) {
|
for (int x = 0; x < 32; x++) {
|
||||||
for (int z = 0; z < 32; z++) {
|
for (int z = 0; z < 32; z++) {
|
||||||
int xzChunk = z * 32 + x;
|
Vector2i chunk = new Vector2i(rX * 32 + x, rZ * 32 + z);
|
||||||
|
if (filter.test(chunk)) {
|
||||||
raf.seek(xzChunk * 4 + 3);
|
|
||||||
int size = raf.readByte() * 4096;
|
int xzChunk = z * 32 + x;
|
||||||
|
|
||||||
if (size == 0) continue;
|
raf.seek(xzChunk * 4 + 3);
|
||||||
|
int size = raf.readByte() * 4096;
|
||||||
raf.seek(xzChunk * 4 + 4096);
|
|
||||||
int timestamp = raf.read() << 24;
|
if (size == 0) continue;
|
||||||
timestamp |= (raf.read() & 0xFF) << 16;
|
|
||||||
timestamp |= (raf.read() & 0xFF) << 8;
|
raf.seek(xzChunk * 4 + 4096);
|
||||||
timestamp |= raf.read() & 0xFF;
|
int timestamp = raf.read() << 24;
|
||||||
|
timestamp |= (raf.read() & 0xFF) << 16;
|
||||||
if (timestamp >= (modifiedSinceMillis / 1000)) {
|
timestamp |= (raf.read() & 0xFF) << 8;
|
||||||
Vector2i chunk = new Vector2i(rX * 32 + x, rZ * 32 + z);
|
timestamp |= raf.read() & 0xFF;
|
||||||
if (filter.test(chunk)) {
|
|
||||||
|
if (timestamp >= (modifiedSinceMillis / 1000)) {
|
||||||
chunks.add(chunk);
|
chunks.add(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user