Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let seed
let regionFolder
if (worldFolder) {
regionFolder = worldFolder + '/region'
try {
await fsStat(regionFolder)
} catch (err) {
await fsMkdir(regionFolder)
}
try {
const levelData = await level.readLevel(worldFolder + '/level.dat')
seed = levelData['RandomSeed'][0]
} catch (err) {
seed = newSeed
await level.writeLevel(worldFolder + '/level.dat', { 'RandomSeed': [seed, 0] })
}
} else { seed = newSeed }
generation.options.seed = seed
generation.options.version = version
serv.emit('seed', generation.options.seed)
const generationModule = generations[generation.name] ? generations[generation.name] : require(generation.name)
serv.overworld = new World(generationModule(generation.options), regionFolder)
serv.netherworld = new World(generations['nether'](generation.options))
// serv.endworld = new World(generations["end"]({}));
// WILL BE REMOVED WHEN ACTUALLY IMPLEMENTED
serv.overworld.blockEntityData = {}
serv.netherworld.blockEntityData = {}
serv.overworld.portals = []
serv.netherworld.portals = []
/// ///////////