1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Make blocks to be loaded from disk when the active block area reaches them

This commit is contained in:
Perttu Ahola 2011-11-27 12:50:35 +02:00
parent ec4f58741b
commit 5c1cb01936
4 changed files with 31 additions and 5 deletions

View file

@ -1078,7 +1078,8 @@ Server::Server(
// Initialize Environment
m_env = new ServerEnvironment(new ServerMap(mapsavedir, this), m_lua, this);
m_env = new ServerEnvironment(new ServerMap(mapsavedir, this), m_lua,
this, this);
// Give environment reference to scripting api
scriptapi_add_environment(m_lua, m_env);
@ -4590,6 +4591,14 @@ void Server::notifyPlayers(const std::wstring msg)
BroadcastChatMessage(msg);
}
void Server::queueBlockEmerge(v3s16 blockpos, bool allow_generate)
{
u8 flags = 0;
if(!allow_generate)
flags |= BLOCK_EMERGE_FLAG_FROMDISK;
m_emerge_queue.addBlock(PEER_ID_INEXISTENT, blockpos, flags);
}
// IGameDef interface
// Under envlock
IToolDefManager* Server::getToolDefManager()