mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Add core.compare_block_status function (#11247)
Makes it possible to check the status of the mapblock in a future-extensible way.
This commit is contained in:
parent
89f3991351
commit
c9144ae5e2
10 changed files with 89 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue