DimensionGenerator.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. #include "DimensionGenerator.h"
  2. #include <iostream>
  3. #include <Logging.h>
  4. #include <Zeit.h>
  5. #include "Constants.h"
  6. #include "Dimension.h"
  7. #include "Game.h"
  8. #include "NoBlock.h"
  9. #include "Noise.h"
  10. #include "RandNoise.h"
  11. #include "WormCaveGenerator.h"
  12. WorldHeightLayer::WorldHeightLayer()
  13. : ReferenceCounter(),
  14. noiseConfig(0),
  15. noise(0),
  16. value(0)
  17. {}
  18. WorldHeightLayer::~WorldHeightLayer()
  19. {
  20. if (noiseConfig) noiseConfig->release();
  21. if (noise) noise->release();
  22. if (value) value->release();
  23. }
  24. void WorldHeightLayer::initialize(JExpressionMemory* zMemory)
  25. {
  26. if (noise) noise->release();
  27. noise = JNoise::parseNoise(noiseConfig, zMemory);
  28. zMemory->setNoise(name, dynamic_cast<Noise*>(noise->getThis()));
  29. valueP = zMemory->getFloatVariableP(name);
  30. value->compile(zMemory);
  31. }
  32. void WorldHeightLayer::calculateValue()
  33. {
  34. *valueP = value->getValue();
  35. }
  36. void WorldHeightLayer::setNoiseConfig(Framework::JSON::JSONObject* noiseConfig)
  37. {
  38. if (this->noiseConfig) this->noiseConfig->release();
  39. this->noiseConfig = noiseConfig;
  40. }
  41. Framework::JSON::JSONObject* WorldHeightLayer::zNoiseConfig() const
  42. {
  43. return noiseConfig;
  44. }
  45. void WorldHeightLayer::setName(Framework::Text name)
  46. {
  47. this->name = name;
  48. }
  49. Framework::Text WorldHeightLayer::getName() const
  50. {
  51. return name;
  52. }
  53. void WorldHeightLayer::setValue(JFloatExpression* value)
  54. {
  55. if (this->value) this->value->release();
  56. this->value = value;
  57. }
  58. JFloatExpression* WorldHeightLayer::zValue() const
  59. {
  60. return value;
  61. }
  62. WorldHeightLayerFactory::WorldHeightLayerFactory() {}
  63. WorldHeightLayer* WorldHeightLayerFactory::fromJson(
  64. Framework::JSON::JSONObject* zJson) const
  65. {
  66. WorldHeightLayer* result = new WorldHeightLayer();
  67. result->setName(zJson->zValue("name")->asString()->getString());
  68. result->setNoiseConfig(zJson->getValue("noise")->asObject());
  69. result->setValue(
  70. Game::INSTANCE->zTypeRegistry()->fromJson<JFloatExpression>(
  71. zJson->zValue("value")));
  72. return result;
  73. }
  74. Framework::JSON::JSONObject* WorldHeightLayerFactory::toJsonObject(
  75. WorldHeightLayer* zObject) const
  76. {
  77. Framework::JSON::JSONObject* result = new Framework::JSON::JSONObject();
  78. result->addValue(
  79. "name", new Framework::JSON::JSONString(zObject->getName()));
  80. result->addValue("noise", zObject->zNoiseConfig());
  81. result->addValue("value",
  82. Game::INSTANCE->zTypeRegistry()->toJson<JFloatExpression>(
  83. zObject->zValue()));
  84. return result;
  85. }
  86. JSONObjectValidationBuilder* WorldHeightLayerFactory::addToValidator(
  87. JSONObjectValidationBuilder* builder) const
  88. {
  89. return builder->withRequiredString("name")
  90. ->finishString()
  91. ->withRequiredAttribute("noise", JNoise::getValidator(false))
  92. ->withRequiredAttribute("value",
  93. Game::INSTANCE->zTypeRegistry()->getValidator<JFloatExpression>());
  94. }
  95. DimensionGenerator::DimensionGenerator()
  96. : ReferenceCounter(),
  97. jExpressionMemory(new JExpressionMemory()),
  98. seedExpression(0),
  99. dimensionId(0)
  100. {}
  101. DimensionGenerator::~DimensionGenerator()
  102. {
  103. jExpressionMemory->release();
  104. if (seedExpression) seedExpression->release();
  105. }
  106. JExpressionMemory* DimensionGenerator::zMemory() const
  107. {
  108. return jExpressionMemory;
  109. }
  110. void DimensionGenerator::calculateHeightLayers()
  111. {
  112. for (WorldHeightLayer* layer : heightLayers)
  113. {
  114. layer->calculateValue();
  115. }
  116. }
  117. Dimension* DimensionGenerator::createDimension()
  118. {
  119. return new Dimension(getId());
  120. }
  121. void DimensionGenerator::initialize(int worldSeed)
  122. {
  123. this->worldSeed = jExpressionMemory->getFloatVariableP("worldSeed");
  124. *this->worldSeed = (float)worldSeed;
  125. this->dimensionSeed = jExpressionMemory->getFloatVariableP("dimensionSeed");
  126. seedExpression->compile(jExpressionMemory);
  127. *this->dimensionSeed = seedExpression->getValue();
  128. for (WorldHeightLayer* layer : heightLayers)
  129. {
  130. layer->initialize(jExpressionMemory);
  131. }
  132. xPos = jExpressionMemory->getFloatVariableP("x");
  133. yPos = jExpressionMemory->getFloatVariableP("y");
  134. zPos = jExpressionMemory->getFloatVariableP("z");
  135. }
  136. int DimensionGenerator::getDimensionId() const
  137. {
  138. return dimensionId;
  139. }
  140. void DimensionGenerator::addHeightLayer(WorldHeightLayer* layer)
  141. {
  142. heightLayers.add(layer);
  143. }
  144. const Framework::RCArray<WorldHeightLayer>&
  145. DimensionGenerator::getHeightLayers() const
  146. {
  147. return heightLayers;
  148. }
  149. void DimensionGenerator::setName(Framework::Text name)
  150. {
  151. this->name = name;
  152. }
  153. Framework::Text DimensionGenerator::getName() const
  154. {
  155. return name;
  156. }
  157. void DimensionGenerator::setId(int id)
  158. {
  159. dimensionId = id;
  160. }
  161. int DimensionGenerator::getId() const
  162. {
  163. return dimensionId;
  164. }
  165. void DimensionGenerator::setSeed(JFloatExpression* seed)
  166. {
  167. if (seedExpression) seedExpression->release();
  168. seedExpression = seed;
  169. }
  170. JFloatExpression* DimensionGenerator::zSeed() const
  171. {
  172. return seedExpression;
  173. }
  174. BiomedCavedDimensionGenerator::BiomedCavedDimensionGenerator()
  175. : DimensionGenerator(),
  176. caveGenerator(0),
  177. noiseConfig(0),
  178. biomNoise(0)
  179. {}
  180. BiomedCavedDimensionGenerator::~BiomedCavedDimensionGenerator()
  181. {
  182. if (noiseConfig) noiseConfig->release();
  183. if (biomNoise) biomNoise->release();
  184. if (caveGenerator) caveGenerator->release();
  185. }
  186. void BiomedCavedDimensionGenerator::initialize(int worldSeed)
  187. {
  188. if (biomNoise) biomNoise->release();
  189. if (caveGenerator) caveGenerator->release();
  190. DimensionGenerator::initialize(worldSeed);
  191. biomNoise = JNoise::parseNoise(noiseConfig, zMemory());
  192. for (BiomGenerator* gen : biomGenerators)
  193. {
  194. gen->initialize(zMemory());
  195. }
  196. caveGenerator = new WormCaveGenerator(75, 150, 1, 6, 0.1f, worldSeed - 1);
  197. }
  198. BiomGenerator* BiomedCavedDimensionGenerator::zBiomGenerator()
  199. {
  200. for (BiomGenerator* generator : biomGenerators)
  201. {
  202. if (generator->isApplicable()) return generator;
  203. }
  204. return 0;
  205. }
  206. Framework::RCArray<GeneratedStructure>*
  207. BiomedCavedDimensionGenerator::getGeneratedStructoresForArea(
  208. Framework::Vec3<int> minPos, Framework::Vec3<int> maxPos)
  209. {
  210. int minSearchX = minPos.x - maxStructureOffset.x;
  211. int minSearchY = minPos.y - maxStructureOffset.y;
  212. int minSearchZ = MAX(minPos.z - maxStructureOffset.z, 0);
  213. int maxSearchX = maxPos.x - minStructureOffset.x;
  214. int maxSearchY = maxPos.y - minStructureOffset.y;
  215. int maxSearchZ = MIN(maxPos.z - minStructureOffset.z, WORLD_HEIGHT - 1);
  216. Framework::RCArray<GeneratedStructure>* result
  217. = new Framework::RCArray<GeneratedStructure>();
  218. for (int x = minSearchX; x <= maxSearchX; x++)
  219. {
  220. for (int y = minSearchY; y <= maxSearchY; y++)
  221. {
  222. *xPos = (float)x;
  223. *yPos = (float)y;
  224. calculateHeightLayers();
  225. BiomGenerator* gen = zBiomGenerator();
  226. for (int z = minSearchZ; z <= maxSearchZ; z++)
  227. {
  228. *zPos = (float)z;
  229. gen->generateStructures(
  230. x, y, z, getDimensionId(), minPos, maxPos, result);
  231. }
  232. }
  233. }
  234. return result;
  235. }
  236. Chunk* BiomedCavedDimensionGenerator::generateChunk(int centerX, int centerY)
  237. {
  238. zMemory()->lock();
  239. #ifdef CHUNK_GENERATION_DEBUG_LOG
  240. Framework::Logging::debug()
  241. << "generating chunk " << centerX << ", " << centerY;
  242. double structureTime = 0;
  243. double caveTime = 0;
  244. double blockGenTime = 0;
  245. Framework::ZeitMesser zm;
  246. Framework::ZeitMesser zmGlobal;
  247. zm.messungStart();
  248. zmGlobal.messungStart();
  249. #endif
  250. Framework::RCArray<GeneratedStructure>* structures
  251. = getGeneratedStructoresForArea(
  252. Framework::Vec3<int>(
  253. centerX - CHUNK_SIZE / 2, centerY - CHUNK_SIZE / 2, 0),
  254. Framework::Vec3<int>(centerX + CHUNK_SIZE / 2,
  255. centerY + CHUNK_SIZE / 2,
  256. WORLD_HEIGHT - 1));
  257. #ifdef CHUNK_GENERATION_DEBUG_LOG
  258. zm.messungEnde();
  259. structureTime += zm.getSekunden();
  260. zm.messungStart();
  261. #endif
  262. CaveChunkGenerator* caveGen
  263. = caveGenerator->getGeneratorForChunk(centerX, centerY);
  264. #ifdef CHUNK_GENERATION_DEBUG_LOG
  265. zm.messungEnde();
  266. caveTime += zm.getSekunden();
  267. #endif
  268. Chunk* chunk
  269. = new Chunk(Framework::Punkt(centerX, centerY), getDimensionId());
  270. zMemory()->setCurrentChunk(dynamic_cast<Chunk*>(chunk->getThis()));
  271. for (int x = -CHUNK_SIZE / 2; x < CHUNK_SIZE / 2; x++)
  272. {
  273. for (int y = -CHUNK_SIZE / 2; y < CHUNK_SIZE / 2; y++)
  274. {
  275. *xPos = (float)x + (float)centerX;
  276. *yPos = (float)y + (float)centerY;
  277. // calculate height layers
  278. calculateHeightLayers();
  279. // calculate biom
  280. BiomGenerator* biom = zBiomGenerator();
  281. // generate blocks
  282. for (int z = 0; z < WORLD_HEIGHT; z++)
  283. {
  284. *zPos = (float)z;
  285. Framework::Either<Block*, int> generated = BlockTypeEnum::AIR;
  286. bool structureAffected = 0;
  287. // check if the block is inside of a structure
  288. for (auto structure : *structures)
  289. {
  290. if (structure->isBlockAffected(
  291. Framework::Vec3<int>(x + centerX, y + centerY, z)))
  292. {
  293. generated = structure->generateBlockAt(
  294. Framework::Vec3<int>(x + centerX, y + centerY, z),
  295. getDimensionId());
  296. structureAffected = 1;
  297. break;
  298. }
  299. }
  300. if (!structureAffected)
  301. {
  302. // check if block is a cave block
  303. bool inCave
  304. = caveGen->isInCave(x + centerX, y + centerY, z);
  305. if (!inCave)
  306. {
  307. // generate biom block
  308. #ifdef CHUNK_GENERATION_DEBUG_LOG
  309. zm.messungStart();
  310. #endif
  311. generated = biom->generateBlock(x + centerX,
  312. y + centerY,
  313. z,
  314. getDimensionId(),
  315. chunk);
  316. #ifdef CHUNK_GENERATION_DEBUG_LOG
  317. zm.messungEnde();
  318. blockGenTime += zm.getSekunden();
  319. #endif
  320. }
  321. }
  322. if (generated.isA())
  323. chunk->putBlockAt(
  324. Framework::Vec3<int>(
  325. x + CHUNK_SIZE / 2, y + CHUNK_SIZE / 2, z),
  326. generated);
  327. else
  328. chunk->putBlockTypeAt(
  329. Framework::Vec3<int>(
  330. x + CHUNK_SIZE / 2, y + CHUNK_SIZE / 2, z),
  331. generated);
  332. }
  333. }
  334. }
  335. caveGen->release();
  336. structures->release();
  337. #ifdef CHUNK_GENERATION_DEBUG_LOG
  338. zmGlobal.messungEnde();
  339. Framework::Logging::trace() << "structureGenerationTime: " << structureTime;
  340. Framework::Logging::trace() << "caveGenerationTime: " << caveTime;
  341. Framework::Logging::trace() << "blockGenTime: " << blockGenTime;
  342. Framework::Logging::debug() << "totalTime: " << zmGlobal.getSekunden();
  343. #endif
  344. zMemory()->unlock();
  345. return chunk;
  346. }
  347. void BiomedCavedDimensionGenerator::generateEntities(Chunk* zChunk)
  348. {
  349. zMemory()->lock();
  350. zMemory()->setCurrentChunk(dynamic_cast<Chunk*>(zChunk->getThis()));
  351. *xPos = (float)zChunk->getCenter().x;
  352. *yPos = (float)zChunk->getCenter().y;
  353. calculateHeightLayers();
  354. BiomGenerator* biom = zBiomGenerator();
  355. for (int x = -CHUNK_SIZE / 2; x < CHUNK_SIZE / 2; x++)
  356. {
  357. for (int y = -CHUNK_SIZE / 2; y < CHUNK_SIZE / 2; y++)
  358. {
  359. for (int z = 0; z < WORLD_HEIGHT; z++)
  360. {
  361. if (zChunk->getBlockTypeAt(Framework::Vec3<int>(
  362. x + CHUNK_SIZE / 2, y + CHUNK_SIZE / 2, z))
  363. == BlockTypeEnum::AIR)
  364. {
  365. *xPos = (float)x + (float)zChunk->getCenter().x;
  366. *yPos = (float)y + (float)zChunk->getCenter().y;
  367. *zPos = (float)z;
  368. biom->generateEntities(x + zChunk->getCenter().x,
  369. y + zChunk->getCenter().y,
  370. z,
  371. getDimensionId());
  372. }
  373. }
  374. }
  375. }
  376. zMemory()->unlock();
  377. }
  378. Framework::Either<Block*, int> BiomedCavedDimensionGenerator::generateBlock(
  379. Framework::Vec3<int> location)
  380. {
  381. Chunk* zChunk
  382. = Game::INSTANCE->zDimension(getDimensionId())
  383. ->zChunk(Game::INSTANCE->getChunkCenter(location.x, location.y));
  384. if (!zChunk)
  385. {
  386. return BlockTypeEnum::NO_BLOCK;
  387. }
  388. zMemory()->lock();
  389. zMemory()->setCurrentChunk(dynamic_cast<Chunk*>(zChunk->getThis()));
  390. Framework::RCArray<GeneratedStructure>* structures
  391. = getGeneratedStructoresForArea(location, location);
  392. *xPos = (float)location.x;
  393. *yPos = (float)location.y;
  394. calculateHeightLayers();
  395. BiomGenerator* biom = zBiomGenerator();
  396. *zPos = (float)location.z;
  397. for (auto structure : *structures)
  398. {
  399. if (structure->isBlockAffected(location))
  400. {
  401. auto generated
  402. = structure->generateBlockAt(location, getDimensionId());
  403. structures->release();
  404. zMemory()->unlock();
  405. return generated;
  406. }
  407. }
  408. structures->release();
  409. Framework::Punkt chunkCenter = Game::getChunkCenter(location.x, location.y);
  410. CaveChunkGenerator* caveGen
  411. = caveGenerator->getGeneratorForChunk(chunkCenter.x, chunkCenter.y);
  412. if (caveGen->isInCave(location.x, location.y, location.z))
  413. {
  414. caveGen->release();
  415. zMemory()->unlock();
  416. return BlockTypeEnum::AIR;
  417. }
  418. caveGen->release();
  419. auto generated = biom->generateBlock(
  420. location.x, location.y, location.z, getDimensionId(), zChunk);
  421. zMemory()->unlock();
  422. return generated;
  423. }
  424. bool BiomedCavedDimensionGenerator::spawnStructure(
  425. Framework::Vec3<int> location,
  426. std::function<bool(GeneratorTemplate* tmpl)> filter)
  427. {
  428. zMemory()->lock();
  429. *xPos = (float)location.x;
  430. *yPos = (float)location.y;
  431. BiomGenerator* biom = zBiomGenerator();
  432. zMemory()->unlock();
  433. for (StructureTemplateCollection* tc : biom->getTemplates())
  434. {
  435. for (GeneratorTemplate* t : tc->getStructures())
  436. {
  437. if (filter(t))
  438. {
  439. RandNoise noise((int)time(0));
  440. GeneratedStructure* genStr
  441. = t->generateAt(location, &noise, getDimensionId());
  442. if (genStr)
  443. {
  444. int minSearchX = location.x + t->getMinAffectedOffset().x;
  445. int minSearchY = location.y + t->getMinAffectedOffset().y;
  446. int minSearchZ
  447. = MAX(location.z + t->getMinAffectedOffset().z, 0);
  448. int maxSearchX = location.x + t->getMaxAffectedOffset().x;
  449. int maxSearchY = location.y + t->getMaxAffectedOffset().y;
  450. int maxSearchZ
  451. = MIN(location.z + t->getMaxAffectedOffset().z,
  452. WORLD_HEIGHT - 1);
  453. for (int x = minSearchX; x <= maxSearchX; x++)
  454. {
  455. for (int y = minSearchY; y <= maxSearchY; y++)
  456. {
  457. for (int z = minSearchZ; z <= maxSearchZ; z++)
  458. {
  459. if (genStr->isBlockAffected(
  460. Framework::Vec3<int>(x, y, z)))
  461. {
  462. auto gen = genStr->generateBlockAt(
  463. Framework::Vec3<int>(x, y, z),
  464. getDimensionId());
  465. Game::INSTANCE->zDimension(getDimensionId())
  466. ->placeBlock(
  467. Framework::Vec3<int>(x, y, z), gen);
  468. }
  469. }
  470. }
  471. }
  472. genStr->release();
  473. zMemory()->unlock();
  474. return 1;
  475. }
  476. }
  477. }
  478. }
  479. return 0;
  480. }
  481. void BiomedCavedDimensionGenerator::addBiomGenerator(
  482. BiomGenerator* biomGenerator)
  483. {
  484. biomGenerators.add(biomGenerator);
  485. if (biomGenerators.getEintragAnzahl() == 1)
  486. {
  487. minStructureOffset = biomGenerator->getMinStructureOffset();
  488. maxStructureOffset = biomGenerator->getMaxStructureOffset();
  489. }
  490. else
  491. {
  492. Framework::Vec3<int> min = biomGenerator->getMinStructureOffset();
  493. Framework::Vec3<int> max = biomGenerator->getMaxStructureOffset();
  494. if (minStructureOffset.x > min.x) minStructureOffset.x = min.x;
  495. if (minStructureOffset.y > min.y) minStructureOffset.y = min.y;
  496. if (minStructureOffset.z > min.z) minStructureOffset.z = min.z;
  497. if (maxStructureOffset.x < max.x) maxStructureOffset.x = max.x;
  498. if (maxStructureOffset.y < max.y) maxStructureOffset.y = max.y;
  499. if (maxStructureOffset.z < max.z) maxStructureOffset.z = max.z;
  500. }
  501. }
  502. const Framework::RCArray<BiomGenerator>&
  503. BiomedCavedDimensionGenerator::getBiomGenerators() const
  504. {
  505. return biomGenerators;
  506. }
  507. void BiomedCavedDimensionGenerator::setBiomNoiseConfig(
  508. Framework::JSON::JSONObject* biomNoiseConfig)
  509. {
  510. if (noiseConfig) noiseConfig->release();
  511. noiseConfig = biomNoiseConfig;
  512. }
  513. Framework::JSON::JSONObject*
  514. BiomedCavedDimensionGenerator::zBiomNoiseConfig() const
  515. {
  516. return noiseConfig;
  517. }
  518. BiomedCavedDimensionGeneratorFactory::BiomedCavedDimensionGeneratorFactory() {}
  519. BiomedCavedDimensionGenerator*
  520. BiomedCavedDimensionGeneratorFactory::createValue(
  521. Framework::JSON::JSONObject* zJson) const
  522. {
  523. return new BiomedCavedDimensionGenerator();
  524. }
  525. BiomedCavedDimensionGenerator* BiomedCavedDimensionGeneratorFactory::fromJson(
  526. Framework::JSON::JSONObject* zJson) const
  527. {
  528. BiomedCavedDimensionGenerator* result
  529. = DimensionGeneratorFactory::fromJson(zJson);
  530. result->setBiomNoiseConfig(zJson->getValue("biomNoise")->asObject());
  531. for (Framework::JSON::JSONValue* value : *zJson->zValue("bioms")->asArray())
  532. {
  533. result->addBiomGenerator(
  534. Game::INSTANCE->zTypeRegistry()->fromJson<BiomGenerator>(value));
  535. }
  536. return result;
  537. }
  538. Framework::JSON::JSONObject* BiomedCavedDimensionGeneratorFactory::toJsonObject(
  539. BiomedCavedDimensionGenerator* zObject) const
  540. {
  541. Framework::JSON::JSONObject* result
  542. = DimensionGeneratorFactory::toJsonObject(zObject);
  543. Framework::JSON::JSONArray* bioms = new Framework::JSON::JSONArray();
  544. for (BiomGenerator* biom : zObject->getBiomGenerators())
  545. {
  546. bioms->addValue(
  547. Game::INSTANCE->zTypeRegistry()->toJson<BiomGenerator>(biom));
  548. }
  549. result->addValue("bioms", bioms);
  550. result->addValue("biomNoise",
  551. dynamic_cast<Framework::JSON::JSONValue*>(
  552. zObject->zBiomNoiseConfig()->getThis()));
  553. return result;
  554. }
  555. JSONObjectValidationBuilder*
  556. BiomedCavedDimensionGeneratorFactory::addToValidator(
  557. JSONObjectValidationBuilder* builder) const
  558. {
  559. return DimensionGeneratorFactory::addToValidator(
  560. builder->withRequiredArray("bioms")
  561. ->addAcceptedTypeInArray(
  562. Game::INSTANCE->zTypeRegistry()->getValidator<BiomGenerator>())
  563. ->finishArray()
  564. ->withRequiredAttribute("biomNoise", JNoise::getValidator(false)));
  565. }
  566. const char* BiomedCavedDimensionGeneratorFactory::getTypeToken() const
  567. {
  568. return "cavedBioms";
  569. }