#include "settings.h"
#include "log.h"
+#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
+
/*
SQLite format specification:
- Initially only replaces sectors/ and sectors2/
v3s16 blockpos = getNodeBlockPos(p);
v3s16 p_rel = p - blockpos*MAP_BLOCKSIZE;
MapBlock *block = getBlockNoCreateNoEx(blockpos);
- if(block == NULL)
+ if(!block){
+ infostream<<"Map::getNodeMetadata(): Need to emerge "
+ <<PP(blockpos)<<std::endl;
+ block = emergeBlock(blockpos, false);
+ }
+ if(!block)
{
- infostream<<"WARNING: Map::setNodeMetadata(): Block not found"
+ infostream<<"WARNING: Map::getNodeMetadata(): Block not found"
<<std::endl;
return NULL;
}
v3s16 blockpos = getNodeBlockPos(p);
v3s16 p_rel = p - blockpos*MAP_BLOCKSIZE;
MapBlock *block = getBlockNoCreateNoEx(blockpos);
- if(block == NULL)
+ if(!block){
+ infostream<<"Map::setNodeMetadata(): Need to emerge "
+ <<PP(blockpos)<<std::endl;
+ block = emergeBlock(blockpos, false);
+ }
+ if(!block)
{
infostream<<"WARNING: Map::setNodeMetadata(): Block not found"
<<std::endl;
// Returns NULL if not found
MapBlock * getBlockNoCreateNoEx(v3s16 p);
+ /* Server overrides */
+ virtual MapBlock * emergeBlock(v3s16 p, bool allow_generate=true)
+ { return getBlockNoCreateNoEx(p); }
+
// Returns InvalidPositionException if not found
bool isNodeUnderground(v3s16 p);