MapBlock * MapSector::createBlankBlockNoInsert(s16 y) { assert(getBlockBuffered(y) == NULL); v3s16 blockpos_map(m_pos.X, y, m_pos.Y); MapBlock *block = new MapBlock(m_parent, blockpos_map); return block; }
MapBlock * Map::createBlankBlockNoInsert(v3s16 & p) { MapBlock *block = getBlockBuffered(p); if (block != NULL) { errorstream<<"Block already created"<<"std::endl"; return block; } block = new MapBlock(this, p, m_gamedef); return block; }
void Map::insertBlock(MapBlock *block) { auto block_p = block->getPos(); auto block2 = getBlockBuffered(block_p); if(block2){ //throw AlreadyExistsException("Block already exists"); infostream<<"Block already exists " << block_p <<std::endl; } // Insert into container m_blocks[block_p] = block; }
MapBlock * MapSector::createBlankBlockNoInsert(s16 y) { MapBlock *block = getBlockBuffered(y); if (block != NULL) { errorstream<<"Block already created"<<"std::endl"; return block; } v3s16 blockpos_map(m_pos.X, y, m_pos.Y); block = new MapBlock(m_parent, blockpos_map, m_gamedef); return block; }
void MapSector::insertBlock(MapBlock *block) { s16 block_y = block->getPos().Y; MapBlock *block2 = getBlockBuffered(block_y); if(block2 != NULL){ throw AlreadyExistsException("Block already exists"); } v2s16 p2d(block->getPos().X, block->getPos().Z); assert(p2d == m_pos); // Insert into container m_blocks.insert(block_y, block); }
void MapSector::insertBlock(MapBlock *block) { s16 block_y = block->getPos().Y; MapBlock *block2 = getBlockBuffered(block_y); if(block2 != NULL){ //throw AlreadyExistsException("Block already exists"); errorstream<<"Block already exists" /*<PP(block->getPos())*/ <<std::endl; } v2s16 p2d(block->getPos().X, block->getPos().Z); assert(p2d == m_pos); // Insert into container m_blocks[block_y] = block; }
MapBlock * MapSector::getBlockNoCreateNoEx(s16 y) { return getBlockBuffered(y); }
MapBlock * Map::getBlockNoCreateNoEx(v3s16 p) { return getBlockBuffered(p); }