#include "server/world/chunk.hh" namespace server { namespace world { void chunk::update() noexcept { if (!this->should_update) { return; } this->packet.clear_chunk_packet(); this->pack(packet.mutable_chunk_packet()); this->should_update = false; } void chunk::write() noexcept { if (!this->should_write) { return; } server::database::write_chunk(this->pos, this->packet.chunk_packet()); this->should_write = false; } chunk::~chunk() noexcept { this->write(); } } // namespace world } // namespace server