mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-11 18:37:40 +01:00
Merge pull request #3603 from kosma/fabric-1.17-section-handling
fabric-1.17.1: add missing section handling
This commit is contained in:
commit
442935d78b
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user