Some uncommited small change that was lying around for a couple months.

This commit is contained in:
IntegratedQuantum 2023-07-23 10:53:57 +02:00
parent 8581a17c48
commit a5763f7307

View File

@ -331,28 +331,23 @@ pub const Chunk = struct {
self.setChanged(); self.setChanged();
} }
pub fn save(self: *Chunk, world: *main.server.ServerWorld) void {
// TODO: self.mutex.lock();
pub fn save(chunk: *const Chunk) void { defer self.mutex.unlock();
_ = chunk; if(self.wasChanged) {
// /** // TODO: ChunkIO.storeChunkToFile(world, this);
// * Saves this chunk. self.wasChanged = false;
// */ // Update the next lod chunk:
// public void save(World world) { if(self.pos.voxelSize != 1 << settings.highestLOD) {
// if(wasChanged) { var pos = self.pos;
// ChunkIO.storeChunkToFile(world, this); pos.wx &= ~pos.voxelSize;
// wasChanged = false; pos.wy &= ~pos.voxelSize;
// // Update the next lod chunk: pos.wz &= ~pos.voxelSize;
// if(voxelSize != 1 << Constants.HIGHEST_LOD) { pos.voxelSize *= 2;
// if(world instanceof ServerWorld) { const nextHigherLod = world.chunkManager.getOrGenerateChunk(pos);
// ReducedChunk chunk = ((ServerWorld)world).chunkManager.getOrGenerateReducedChunk(wx, wy, wz, voxelSize*2); nextHigherLod.updateFromLowerResolution(self);
// chunk.updateFromLowerResolution(this); }
// } else { }
// Logger.error("Not implemented: ");
// Logger.error(new Exception());
// }
// }
// }
} }
// TODO: Check if/how they are needed: // TODO: Check if/how they are needed: