DimensionGenerator.cpp 20 KB

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