Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
MapBlock * MapSector::getBlockNoCreateNoEx(s16 y)
{
	return getBlockBuffered(y);
}
Ejemplo n.º 8
0
MapBlock * Map::getBlockNoCreateNoEx(v3s16 p)
{
	return getBlockBuffered(p);
}