Map::Map(std::ostream &dout, IGameDef *gamedef):
m_dout(dout),
m_gamedef(gamedef),
- m_sector_cache(NULL),
- m_nodedef(gamedef->ndef()),
- m_transforming_liquid_loop_count_multiplier(1.0f),
- m_unprocessed_count(0),
- m_inc_trending_up_start_time(0),
- m_queue_size_timer_started(false)
+ m_nodedef(gamedef->ndef())
{
}
return succeeded;
}
-bool Map::getDayNightDiff(v3s16 blockpos)
-{
- try{
- v3s16 p = blockpos + v3s16(0,0,0);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- // Leading edges
- try{
- v3s16 p = blockpos + v3s16(-1,0,0);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- try{
- v3s16 p = blockpos + v3s16(0,-1,0);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- try{
- v3s16 p = blockpos + v3s16(0,0,-1);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- // Trailing edges
- try{
- v3s16 p = blockpos + v3s16(1,0,0);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- try{
- v3s16 p = blockpos + v3s16(0,1,0);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
- try{
- v3s16 p = blockpos + v3s16(0,0,1);
- MapBlock *b = getBlockNoCreate(p);
- if(b->getDayNightDiff())
- return true;
- }
- catch(InvalidPositionException &e){}
-
- return false;
-}
-
struct TimeOrderedMapBlock {
MapSector *sect;
MapBlock *block;
time_until_purge *= 1000; // seconds -> milliseconds
- u32 curr_time = porting::getTime(PRECISION_MILLI);
+ u64 curr_time = porting::getTimeMs();
u32 prev_unprocessed = m_unprocessed_count;
m_unprocessed_count = m_transforming_liquid.size();
EmergeManager *emerge):
Map(dout_server, gamedef),
settings_mgr(g_settings, savedir + DIR_DELIM + "map_meta.txt"),
- m_emerge(emerge),
- m_map_metadata_changed(true)
+ m_emerge(emerge)
{
verbosestream<<FUNCTION_NAME<<std::endl;
return getMapgenParams()->water_level;
}
+bool ServerMap::saoPositionOverLimit(const v3f &p)
+{
+ return getMapgenParams()->saoPosOverLimit(p);
+}
+
bool ServerMap::blockpos_over_mapgen_limit(v3s16 p)
{
const s16 mapgen_limit_bp = rangelim(
return block;
}
-void ServerMap::prepareBlock(MapBlock *block) {
-}
-
// N.B. This requires no synchronization, since data will not be modified unless
// the VoxelManipulator being updated belongs to the same thread.
void ServerMap::updateVManip(v3s16 pos)
MMVManip::MMVManip(Map *map):
VoxelManipulator(),
- m_is_dirty(false),
- m_create_area(false),
m_map(map)
{
}