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

Method placeDungeon

source/game/StarWorldServer.cpp:1139–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137}
1138
1139bool WorldServer::placeDungeon(String const& dungeonName, Vec2I const& position, Maybe<DungeonId> dungeonId, bool forcePlacement) {
1140 m_generatingDungeon = true;
1141 m_tileProtectionEnabled = false;
1142
1143 auto seed = worldTemplate()->seedFor(position[0], position[1]);
1144 auto facade = make_shared<DungeonGeneratorWorld>(this, true);
1145 bool placed = false;
1146 DungeonGenerator dungeonGenerator(dungeonName, seed, m_worldTemplate->threatLevel(), dungeonId);
1147 if (auto generateResult = dungeonGenerator.generate(facade, position, false, forcePlacement)) {
1148 auto worldGenerator = make_shared<WorldGenerator>(this);
1149 for (auto position : generateResult->second) {
1150 if (ServerTile* tile = modifyServerTile(position))
1151 worldGenerator->replaceBiomeBlocks(tile);
1152 }
1153 placed = true;
1154 }
1155
1156 m_tileProtectionEnabled = true;
1157 m_generatingDungeon = false;
1158
1159 return placed;
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]);

Callers 3

processUniverseFlagsMethod · 0.45
instanceWorldPromiseMethod · 0.45
makeWorldCallbacksFunction · 0.45

Calls 4

seedForMethod · 0.80
replaceBiomeBlocksMethod · 0.80
threatLevelMethod · 0.45
generateMethod · 0.45

Tested by

no test coverage detected