conf.set("mod_storage_backend", "sqlite3");
conf.setBool("creative_mode", g_settings->getBool("creative_mode"));
conf.setBool("enable_damage", g_settings->getBool("enable_damage"));
+ if (MAP_BLOCKSIZE != 16)
+ conf.set("blocksize", std::to_string(MAP_BLOCKSIZE));
if (!conf.updateConfigFile(worldmt_path.c_str())) {
throw BaseException("Failed to update the config file");
// If we open world.mt read the backend configurations.
if (succeeded) {
+ // Check that the world's blocksize matches the compiled MAP_BLOCKSIZE
+ u16 blocksize = 16;
+ conf.getU16NoEx("blocksize", blocksize);
+ if (blocksize != MAP_BLOCKSIZE) {
+ throw BaseException(std::string("The map's blocksize is not supported."));
+ }
+
// Read those values before setting defaults
bool player_backend_exists = conf.exists("player_backend");
bool auth_backend_exists = conf.exists("auth_backend");