#include "map_settings_manager.h"
class Settings;
-class Database;
+class MapDatabase;
class ClientMap;
class MapSector;
class ServerMapSector;
// For debug printing. Prints "Map: ", "ServerMap: " or "ClientMap: "
virtual void PrintInfo(std::ostream &out);
- void transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks);
+ void transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks,
+ ServerEnvironment *env);
/*
Node metadata
/*
Database functions
*/
- static Database *createDatabase(const std::string &name, const std::string &savedir, Settings &conf);
+ static MapDatabase *createDatabase(const std::string &name, const std::string &savedir, Settings &conf);
// Returns true if the database file does not exist
bool loadFromFolders();
bool loadSectorMeta(v2s16 p2d);
bool saveBlock(MapBlock *block);
- static bool saveBlock(MapBlock *block, Database *db);
+ static bool saveBlock(MapBlock *block, MapDatabase *db);
// This will generate a sector with getSector if not found.
void loadBlock(const std::string §ordir, const std::string &blockfile,
MapSector *sector, bool save_after_load=false);
u64 getSeed();
s16 getWaterLevel();
+ /*!
+ * Fixes lighting in one map block.
+ * May modify other blocks as well, as light can spread
+ * out of the specified block.
+ * Returns false if the block is not generated (so nothing
+ * changed), true otherwise.
+ */
+ bool repairBlockLight(v3s16 blockpos,
+ std::map<v3s16, MapBlock *> *modified_blocks);
+
MapSettingsManager settings_mgr;
private:
This is reset to false when written on disk.
*/
bool m_map_metadata_changed;
- Database *dbase;
+ MapDatabase *dbase;
};