Skip to content

Commit

Permalink
fix: support world generation for all latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Jun 12, 2024
1 parent 84071ac commit 36ccbfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ world/*
!world/.gitkeep
package-lock.json
worlds*
native/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"change-case": "^4.1.2",
"colors": "1.4.0",
"diamond-square": "^1.2.0",
"diamond-square": "github:zardoy/diamond-square",
"emit-then": "^2.0.0",
"@tootallnate/once": "2.0.0",
"exit-hook": "^2.2.1",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/modules/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import generations from '../generations'
import { Vec3 } from 'vec3'
import { generateSpiralMatrix } from '../../utils'
import { longArrayToNumber, writeLevelDat } from '../../levelDat'
import { getRenamedData } from '../../blockRenames'

const fsStat = promisify(fs.stat)
const fsMkdir = promisify(fs.mkdir)
Expand Down Expand Up @@ -69,6 +70,7 @@ export const server: ServerModule = async function (serv, options) {
...generation.options,
seed,
version,
getRenamedData
}
serv.emit('seed', generationOptions.seed)
const generationModule: (options) => any = generations[generation.name] ? generations[generation.name] : require(generation.name)
Expand Down

0 comments on commit 36ccbfa

Please sign in to comment.