MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addBiomeRegion

Method addBiomeRegion

source/game/StarWorldServer.cpp:1162–1178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1160}
1161
1162void 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
1180void WorldServer::expandBiomeRegion(Vec2I const& position, int newWidth) {
1181 newWidth = std::min(newWidth, (int)m_worldTemplate->size()[0]);

Callers

nothing calls this directly

Calls 5

sectorsForRegionMethod · 0.80
sizeMethod · 0.45
previewAddBiomeRegionMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected