Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
with:
node-version: 24.x
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
distribution: 'temurin'
java-version: ${{ matrix.mcVersion == '26.1.2' && '26' || '21' }}
- name: Install dependencies
run: npm install
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Parse and serialize minecraft packets, plus authentication and encryption.
1.15 (1.15, 1.15.1, 1.15.2), 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.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6),
1.21, 1.21.1, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.8, 1.21.9, 1.21.11
1.21, 1.21.1, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.8, 1.21.9, 1.21.11, 26.1.2
<!--add_next_version_above-->

* Parses all packets and emits events with packet fields as JavaScript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"debug": "^4.3.2",
"endian-toggle": "^0.0.0",
"lodash.merge": "^4.3.0",
"minecraft-data": "^3.78.0",
"minecraft-data": "github:mneuhaus/node-minecraft-data#add-26.1.2-data-wrapper",
"minecraft-folder-path": "^1.2.0",
"node-fetch": "^2.6.1",
"node-rsa": "^0.4.2",
Expand Down
4 changes: 2 additions & 2 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

module.exports = {
defaultVersion: '1.21.11',
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', '1.21.3', '1.21.4', '1.21.5', '1.21.6', '1.21.8', '1.21.9', '1.21.11']
defaultVersion: '26.1.2',
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', '1.21.3', '1.21.4', '1.21.5', '1.21.6', '1.21.8', '1.21.9', '1.21.11', '26.1.2']
}
8 changes: 7 additions & 1 deletion test/packetTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ function getFixedPacketPayload (version, packetName) {
}
}
if (packetName === 'declare_recipes') {
if (version['>=']('1.21.3')) {
if (version['>=']('26.1.2')) {
return {
data: Buffer.alloc(0)
}
} else if (version['>=']('1.21.3')) {
return {
recipes: [
{
Expand Down Expand Up @@ -554,6 +558,8 @@ for (const supportedVersion of mc.supportedVersions) {
}

function assertPacketsMatch (p1, p2) {
p1 = p1 || {}
p2 = p2 || {}
packetInfo.forEach(function (field) {
assert.deepEqual(p1[field], p2[field])
})
Expand Down
6 changes: 5 additions & 1 deletion test/serverTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ for (const supportedVersion of mc.supportedVersions) {
})

it('supports bundle packet', function (done) {
const updateTimeFields = mcData.protocol.play.toClient.types.packet_update_time[1].map(field => field.name)
const updateTimePacket = updateTimeFields.includes('clockUpdates')
? { gameTime: 1, clockUpdates: Buffer.alloc(0) }
: { age: 1, time: 2 }
const server = mc.createServer({
'online-mode': false,
version: version.minecraftVersion,
Expand All @@ -511,7 +515,7 @@ for (const supportedVersion of mc.supportedVersions) {
})
client.write('login', loginPacket(client, server))
client.writeBundle([
['update_time', { age: 1, time: 2 }],
['update_time', updateTimePacket],
['close_window', { windowId: 0 }]
])
})
Expand Down
Loading