Export defaultVersion (#984)

* export defaultVersion

* added defaultVersion to api documentation
This commit is contained in:
Matthias Neid 2022-04-13 13:50:42 +02:00 committed by GitHub
parent aac5494a12
commit ffe912b2fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -325,6 +325,10 @@ The minecraft protocol states.
The supported minecraft versions.
## mc.defaultVersion
The current default minecraft version.
## mc.createSerializer({ state = states.HANDSHAKING, isServer = false , version})
Returns a minecraft protocol [serializer](https://github.com/roblabla/ProtoDef#serializerprotomaintype) for these parameters.

3
src/index.d.ts vendored
View file

@ -245,7 +245,8 @@ declare module 'minecraft-protocol' {
}
export const states: typeof States
export const supportedVersions: ['1.7', '1.8', '1.9', '1.10', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.5', '1.17.1']
export const supportedVersions: string[]
export const defaultVersion: string
export function createServer(options: ServerOptions): Server
export function createClient(options: ClientOptions): Client

View file

@ -15,5 +15,6 @@ module.exports = {
createSerializer: serializer.createSerializer,
createDeserializer: serializer.createDeserializer,
ping: require('./ping'),
supportedVersions: require('./version').supportedVersions
supportedVersions: require('./version').supportedVersions,
defaultVersion: require('./version').defaultVersion
}