forked from SteamWar/SteamWar
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user