1.21 Support (#1342)

* Update default version

* Update README

* 1.21.1

* Update version.js

* Update ci.yml

* Update version.js

* add values for vec2f and ChatTypes

* fix lint

* fix server tests

* fix lint

* update mcdata

* remove debug install

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
This commit is contained in:
Grooble 2024-10-26 23:52:46 +02:00 committed by GitHub
parent 11e8594bb4
commit 5bebac3662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 5 deletions

View file

@ -13,7 +13,7 @@ Parse and serialize minecraft packets, plus authentication and encryption.
* Supports Minecraft PC version 1.7.10, 1.8.8, 1.9 (15w40b, 1.9, 1.9.1-pre2, 1.9.2, 1.9.4), * Supports Minecraft PC version 1.7.10, 1.8.8, 1.9 (15w40b, 1.9, 1.9.1-pre2, 1.9.2, 1.9.4),
1.10 (16w20a, 1.10-pre1, 1.10, 1.10.1, 1.10.2), 1.11 (16w35a, 1.11, 1.11.2), 1.12 (17w15a, 17w18b, 1.12-pre4, 1.12, 1.12.1, 1.12.2), and 1.13 (17w50a, 1.13, 1.13.1, 1.13.2-pre1, 1.13.2-pre2, 1.13.2), 1.14 (1.14, 1.14.1, 1.14.3, 1.14.4) 1.10 (16w20a, 1.10-pre1, 1.10, 1.10.1, 1.10.2), 1.11 (16w35a, 1.11, 1.11.2), 1.12 (17w15a, 17w18b, 1.12-pre4, 1.12, 1.12.1, 1.12.2), and 1.13 (17w50a, 1.13, 1.13.1, 1.13.2-pre1, 1.13.2-pre2, 1.13.2), 1.14 (1.14, 1.14.1, 1.14.3, 1.14.4)
, 1.15 (1.15, 1.15.1, 1.15.2) and 1.16 (20w13b, 20w14a, 1.16-rc1, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5), 1.17 (21w07a, 1.17, 1.17.1), 1.18 (1.18, 1.18.1 and 1.18.2), 1.19 (1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6) , 1.15 (1.15, 1.15.1, 1.15.2) and 1.16 (20w13b, 20w14a, 1.16-rc1, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5), 1.17 (21w07a, 1.17, 1.17.1), 1.18 (1.18, 1.18.1 and 1.18.2), 1.19 (1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21.1)
* Parses all packets and emits events with packet fields as JavaScript * Parses all packets and emits events with packet fields as JavaScript
objects. objects.
* Send a packet by supplying fields as a JavaScript object. * Send a packet by supplying fields as a JavaScript object.

View file

@ -52,7 +52,7 @@
"endian-toggle": "^0.0.0", "endian-toggle": "^0.0.0",
"lodash.get": "^4.1.2", "lodash.get": "^4.1.2",
"lodash.merge": "^4.3.0", "lodash.merge": "^4.3.0",
"minecraft-data": "^3.75.0", "minecraft-data": "^3.78.0",
"minecraft-folder-path": "^1.2.0", "minecraft-folder-path": "^1.2.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"node-rsa": "^0.4.2", "node-rsa": "^0.4.2",

View file

@ -1,6 +1,6 @@
'use strict' 'use strict'
module.exports = { module.exports = {
defaultVersion: '1.20.6', defaultVersion: '1.21.1',
supportedVersions: ['1.7', '1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.5', '1.17.1', '1.18.2', '1.19', '1.19.2', '1.19.3', '1.19.4', '1.20', '1.20.1', '1.20.2', '1.20.4', '1.20.6'] supportedVersions: ['1.7', '1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.5', '1.17.1', '1.18.2', '1.19', '1.19.2', '1.19.3', '1.19.4', '1.20', '1.20.1', '1.20.2', '1.20.4', '1.20.6', '1.21.1']
} }

View file

@ -135,6 +135,9 @@ const values = {
delete results['..'] delete results['..']
return results return results
}, },
vec2f: {
x: 0, y: 0
},
vec3f: { vec3f: {
x: 0, y: 0, z: 0 x: 0, y: 0, z: 0
}, },
@ -153,6 +156,9 @@ const values = {
SlotComponent: { SlotComponent: {
type: 'hide_tooltip' type: 'hide_tooltip'
}, },
ChatTypes: {
registryIndex: 1
},
SlotComponentType: 0, SlotComponentType: 0,
nbt: nbtValue, nbt: nbtValue,
optionalNbt: nbtValue, optionalNbt: nbtValue,

View file

@ -83,7 +83,7 @@ for (const supportedVersion of mc.supportedVersions) {
plainMessage: message, plainMessage: message,
signedChatContent: '', signedChatContent: '',
unsignedChatContent: JSON.stringify({ text: message }), unsignedChatContent: JSON.stringify({ text: message }),
type: 0, type: mcData.supportFeature('incrementedChatType') ? { registryIndex: 1 } : 0,
senderUuid: 'd3527a0b-bc03-45d5-a878-2aafdd8c8a43', // random senderUuid: 'd3527a0b-bc03-45d5-a878-2aafdd8c8a43', // random
senderName: JSON.stringify({ text: sender }), senderName: JSON.stringify({ text: sender }),
senderTeam: undefined, senderTeam: undefined,