diff options
Diffstat (limited to 'src/serverenvironment.cpp')
-rw-r--r-- | src/serverenvironment.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp index 3d9ba132b..413a785e6 100644 --- a/src/serverenvironment.cpp +++ b/src/serverenvironment.cpp @@ -1542,6 +1542,21 @@ void ServerEnvironment::step(float dtime) m_server->sendDetachedInventories(PEER_ID_INEXISTENT, true); } +ServerEnvironment::BlockStatus ServerEnvironment::getBlockStatus(v3s16 blockpos) +{ + if (m_active_blocks.contains(blockpos)) + return BS_ACTIVE; + + const MapBlock *block = m_map->getBlockNoCreateNoEx(blockpos); + if (block && !block->isDummy()) + return BS_LOADED; + + if (m_map->isBlockInQueue(blockpos)) + return BS_EMERGING; + + return BS_UNKNOWN; +} + u32 ServerEnvironment::addParticleSpawner(float exptime) { // Timers with lifetime 0 do not expire |