diff --git a/src/api/world-compute.ts b/src/api/world-compute.ts index 8b3b42b..2ab8f2a 100644 --- a/src/api/world-compute.ts +++ b/src/api/world-compute.ts @@ -66,13 +66,13 @@ const getBiomeBoundsInfluences = (bounds: Box2) => { } const boundsPoints = getPatchBoundingPoints(bounds) const boundsInfluences = {} as PatchBoundingBiomes - ;[xMyM, xMyP, xPyM, xPyP].map(key => { - const boundPos = boundsPoints[key] as Vector2 - const biomeInfluence = Biome.instance.getBiomeInfluence(asVect3(boundPos)) - boundsInfluences[key] = biomeInfluence - // const block = computeGroundBlock(asVect3(pos), biomeInfluence) - return biomeInfluence - }) + ;[xMyM, xMyP, xPyM, xPyP].map(key => { + const boundPos = boundsPoints[key] as Vector2 + const biomeInfluence = Biome.instance.getBiomeInfluence(asVect3(boundPos)) + boundsInfluences[key] = biomeInfluence + // const block = computeGroundBlock(asVect3(pos), biomeInfluence) + return biomeInfluence + }) const allEquals = equals(boundsInfluences[xMyM], boundsInfluences[xPyM]) && equals(boundsInfluences[xMyM], boundsInfluences[xMyP]) && @@ -121,7 +121,7 @@ export const computeGroundBlock = ( if (nominalConf.next?.data) { const variation = Biome.instance.posRandomizer.eval( blockPos.clone().multiplyScalar(50), - ) + ) const min = new Vector2(nominalConf.data.x, nominalConf.data.y) const max = new Vector2(nominalConf.next.data.x, nominalConf.next.data.y) const rangeBox = new Box2(min, max) @@ -187,7 +187,7 @@ export const computeBlocksBatch = async ( biomeBoundsInfluences, ) block.data = computeGroundBlock(block.pos, blockBiome) - // const {level, type } = + // const {level, type } = // override with last block if specified if (params.includeEntitiesBlocks) { const lastBlockData = await queryLastBlockData(asVect2(block.pos)) diff --git a/src/common/utils.ts b/src/common/utils.ts index 4f28608..ceadb60 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -13,9 +13,8 @@ import { LandscapesConf, } from './types' -const typesNumbering = (types: Record, offset = 0) => Object.keys(types).forEach( - (key, i) => (types[key] = offset + i), -) +const typesNumbering = (types: Record, offset = 0) => + Object.keys(types).forEach((key, i) => (types[key] = offset + i)) // Clamp number between two values: const clamp = (num: number, min: number, max: number) => @@ -365,10 +364,10 @@ const parseBox3Stub = (stub: Box3) => { const parseThreeStub = (stub: any) => { return stub ? parseBox3Stub(stub) || - parseVect3Stub(stub) || - parseBox2Stub(stub) || - parseVect2Stub(stub) || - stub + parseVect3Stub(stub) || + parseBox2Stub(stub) || + parseVect2Stub(stub) || + stub : stub } diff --git a/src/procgen/Biome.ts b/src/procgen/Biome.ts index 6810aaa..bb9e054 100644 --- a/src/procgen/Biome.ts +++ b/src/procgen/Biome.ts @@ -73,11 +73,13 @@ export enum BiomeType { export const BiomeNumericType: Record = { [BiomeType.Temperate]: 0, [BiomeType.Artic]: 0, - [BiomeType.Desert]: 0 + [BiomeType.Desert]: 0, } Utils.typesNumbering(BiomeNumericType) export const ReverseBiomeNumericType: Record = {} -Object.keys(BiomeNumericType).forEach((type, i) => ReverseBiomeNumericType[i] = type as BiomeType) +Object.keys(BiomeNumericType).forEach((type, i) => { + ReverseBiomeNumericType[i] = type as BiomeType +}) type Contribution = Record