Skip to content

Commit

Permalink
feat: add basic support for newer versions including up to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Apr 29, 2024
1 parent d518be2 commit 3580d3f
Show file tree
Hide file tree
Showing 15 changed files with 3,023 additions and 302 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"prismarine-item": "^1.14.0",
"prismarine-nbt": "^2.2.1",
"prismarine-provider-anvil": "github:zardoy/prismarine-provider-anvil#everything",
"rambda": "^9.2.0",
"prismarine-windows": "^2.8.0",
"prismarine-world": "^3.6.2",
"random-seed": "^0.3.0",
Expand All @@ -77,5 +78,10 @@
"pkg": "^5.8.1",
"typescript": "^5.3.3",
"vitest": "^0.34.6"
},
"pnpm": {
"overrides": {
"protodef": "npm:@zardoy/protodef"
}
}
}
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ class MCServer extends EventEmitter {
console.warn(`Version ${version.minecraftVersion} is not supported.`)
}
server.supportFeature = feature => {
if (feature === 'theFlattening') feature = 'blockStateId'
if (feature === 'theFlattening') feature = 'blockStateId' as any
return mcData.supportFeature(feature)
}
server.commands = new Command({})
// pass version, motd, port, max-players, online-mode
server._server = createServer(options)

const promises: Promise<any>[] = []
Expand Down Expand Up @@ -95,7 +96,7 @@ declare global {
commands: Command
pluginsReady: boolean
_server: ProtocolServer
supportFeature: (feature: string) => boolean
supportFeature: IndexedData['supportFeature']
}
}

Expand Down
Loading

0 comments on commit 3580d3f

Please sign in to comment.