mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
fabric-1.17.1: add missing section handling
Fixes missing handling introduced in
57d02007ab
.
This commit is contained in:
parent
25950167ec
commit
b234153a53
@ -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