Skip to content

Commit 5bebac3

Browse files
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 <[email protected]>
1 parent 11e8594 commit 5bebac3

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Parse and serialize minecraft packets, plus authentication and encryption.
1313

1414
* 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),
1515
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)
16-
, 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)
16+
, 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)
1717
* Parses all packets and emits events with packet fields as JavaScript
1818
objects.
1919
* Send a packet by supplying fields as a JavaScript object.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"endian-toggle": "^0.0.0",
5353
"lodash.get": "^4.1.2",
5454
"lodash.merge": "^4.3.0",
55-
"minecraft-data": "^3.75.0",
55+
"minecraft-data": "^3.78.0",
5656
"minecraft-folder-path": "^1.2.0",
5757
"node-fetch": "^2.6.1",
5858
"node-rsa": "^0.4.2",

src/version.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

33
module.exports = {
4-
defaultVersion: '1.20.6',
5-
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']
4+
defaultVersion: '1.21.1',
5+
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']
66
}

test/packetTest.js

+6
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ const values = {
135135
delete results['..']
136136
return results
137137
},
138+
vec2f: {
139+
x: 0, y: 0
140+
},
138141
vec3f: {
139142
x: 0, y: 0, z: 0
140143
},
@@ -153,6 +156,9 @@ const values = {
153156
SlotComponent: {
154157
type: 'hide_tooltip'
155158
},
159+
ChatTypes: {
160+
registryIndex: 1
161+
},
156162
SlotComponentType: 0,
157163
nbt: nbtValue,
158164
optionalNbt: nbtValue,

test/serverTest.js

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

0 commit comments

Comments
 (0)