fabric-1.17.1: add missing section handling

Fixes missing handling introduced in
57d02007ab.
This commit is contained in:
Kosma Moczek 2022-01-07 00:59:55 +01:00
parent 25950167ec
commit b234153a53
1 changed files with 7 additions and 4 deletions

View File

@ -713,18 +713,21 @@ public class DynmapPlugin {
ChunkPos cp = chunk.getPos();
if (fw != null) {
if (!checkIfKnownChunk(fw, cp)) {
int ymax = 0;
int ymax = Integer.MIN_VALUE;
int ymin = Integer.MAX_VALUE;
ChunkSection[] sections = chunk.getSectionArray();
for (int i = 0; i < sections.length; i++) {
if ((sections[i] != null) && (!sections[i].isEmpty())) {
ymax = 16 * (i + 1);
int sy = sections[i].getYOffset();
if (sy < ymin) ymin = sy;
if ((sy+16) > ymax) ymax = sy + 16;
}
}
int x = cp.x << 4;
int z = cp.z << 4;
// If not empty AND not initial scan
if (ymax > 0) {
mapManager.touchVolume(fw.getName(), x, 0, z, x + 15, ymax, z + 16, "chunkgenerate");
if (ymax != Integer.MIN_VALUE) {
mapManager.touchVolume(fw.getName(), x, ymin, z, x + 15, ymax, z + 15, "chunkgenerate");
}
addKnownChunk(fw, cp);
}