Allow removing hulls and resend their chunks

HullHider#removeHull stops hiding a hull: it shows the entities and REntities
the hull hid and resends its chunks to everybody who could not view it. A hull
is enabled again by adding and initialising it.

Hull#resendChunks only resends chunks the player has loaded. HullHider now
resends the chunks to non-viewers after initialising a hull itself, so
FightHullHider no longer does it.
This commit is contained in:
2026-10-31 15:09:04 +01:00
parent ce2a23f4b8
commit d1fb4ca67e
4 changed files with 82 additions and 10 deletions
@@ -90,10 +90,22 @@ public final class HullRegion {
}
}
public void forEachChunk(ChunkConsumer executor) {
for (int chunkX = minX >> 4; chunkX <= (maxX - 1) >> 4; chunkX++) {
for (int chunkZ = minZ >> 4; chunkZ <= (maxZ - 1) >> 4; chunkZ++) {
executor.accept(chunkX, chunkZ);
}
}
}
public interface BlockConsumer {
void accept(int x, int y, int z);
}
public interface ChunkConsumer {
void accept(int chunkX, int chunkZ);
}
@Override
public String toString() {
return minX + "," + minY + "," + minZ + "->" + maxX + "," + maxY + "," + maxZ;