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

Method addBiomeRegion

source/game/StarCommandProcessor.cpp:841–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

839}
840
841String CommandProcessor::addBiomeRegion(ConnectionId connectionId, String const& argumentString) {
842 if (auto errorMsg = adminCheck(connectionId, "add biome regions"))
843 return *errorMsg;
844
845 auto arguments = m_parser.tokenizeToStringList(argumentString);
846
847 String biomeName = arguments.at(0);
848 int width = lexicalCast<int>(arguments.at(1));
849
850 String subBlockSelector = "largeClumps";
851 if (arguments.size() > 2)
852 subBlockSelector = arguments.at(2);
853
854 bool done = m_universe->executeForClient(connectionId,
855 [biomeName, width, subBlockSelector](WorldServer* world, PlayerPtr const& player) {
856 world->addBiomeRegion(Vec2I::floor(player->aimPosition()), biomeName, subBlockSelector, width);
857 });
858
859 return done ? strf("added region of biome {} with width {}", biomeName, width) : "failed to add biome region";
860}
861
862String CommandProcessor::expandBiomeRegion(ConnectionId connectionId, String const& argumentString) {
863 if (auto errorMsg = adminCheck(connectionId, "expand biome regions"))

Callers

nothing calls this directly

Calls 6

strfFunction · 0.85
tokenizeToStringListMethod · 0.80
executeForClientMethod · 0.80
atMethod · 0.45
sizeMethod · 0.45
aimPositionMethod · 0.45

Tested by

no test coverage detected