| 1160 | } |
| 1161 | |
| 1162 | void WorldServer::addBiomeRegion(Vec2I const& position, String const& biomeName, String const& subBlockSelector, int width) { |
| 1163 | width = std::min(width, (int)m_worldTemplate->size()[0]); |
| 1164 | |
| 1165 | auto regions = m_worldTemplate->previewAddBiomeRegion(position, width); |
| 1166 | |
| 1167 | if (regions.empty()) { |
| 1168 | Logger::info("Aborting addBiomeRegion as it would have no result!"); |
| 1169 | return; |
| 1170 | } |
| 1171 | |
| 1172 | for (auto region : regions) { |
| 1173 | for (auto sector : m_worldStorage->sectorsForRegion(region)) |
| 1174 | m_worldStorage->triggerTerraformSector(sector); |
| 1175 | } |
| 1176 | |
| 1177 | m_worldTemplate->addBiomeRegion(position, biomeName, subBlockSelector, width); |
| 1178 | } |
| 1179 | |
| 1180 | void WorldServer::expandBiomeRegion(Vec2I const& position, int newWidth) { |
| 1181 | newWidth = std::min(newWidth, (int)m_worldTemplate->size()[0]); |
nothing calls this directly
no test coverage detected