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;
bool addNodeWithEvent(v3s16 p, MapNode n, bool remove_metadata = true);
bool removeNodeWithEvent(v3s16 p);
- /*
- Takes the blocks at the edges into account
- */
- bool getDayNightDiff(v3s16 blockpos);
-
- //core::aabbox3d<s16> getDisplayedBlockArea();
-
- //bool updateChangedVisibleArea();
-
// Call these before and after saving of many blocks
virtual void beginSave() { return; }
virtual void endSave() { return; }