minecraft-data 3.9.0 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.github/workflows/ci.yml +1 -6
  2. package/.github/workflows/md-release.yml +5 -4
  3. package/.github/workflows/npm-publish.yml +1 -2
  4. package/.github/workflows/trigger.yml +2 -2
  5. package/README.md +14 -15
  6. package/data.js +22 -1
  7. package/doc/api.md +460 -167
  8. package/doc/history.md +410 -176
  9. package/index.d.ts +152 -125
  10. package/lib/indexes.js +0 -2
  11. package/lib/loader.js +1 -2
  12. package/minecraft-data/README.md +1 -1
  13. package/minecraft-data/data/bedrock/1.16.201/proto.yml +1 -1
  14. package/minecraft-data/data/bedrock/1.16.201/protocol.json +1 -1
  15. package/minecraft-data/data/bedrock/1.16.210/proto.yml +1 -1
  16. package/minecraft-data/data/bedrock/1.16.210/protocol.json +1 -1
  17. package/minecraft-data/data/bedrock/1.16.220/proto.yml +1 -1
  18. package/minecraft-data/data/bedrock/1.16.220/protocol.json +1 -1
  19. package/minecraft-data/data/bedrock/1.17.0/proto.yml +1 -1
  20. package/minecraft-data/data/bedrock/1.17.0/protocol.json +1 -1
  21. package/minecraft-data/data/bedrock/1.17.10/proto.yml +1 -1
  22. package/minecraft-data/data/bedrock/1.17.10/protocol.json +1 -1
  23. package/minecraft-data/data/bedrock/1.17.30/proto.yml +1 -1
  24. package/minecraft-data/data/bedrock/1.17.30/protocol.json +1 -1
  25. package/minecraft-data/data/bedrock/1.17.40/proto.yml +1 -1
  26. package/minecraft-data/data/bedrock/1.17.40/protocol.json +1 -1
  27. package/minecraft-data/data/bedrock/1.18.0/proto.yml +1 -1
  28. package/minecraft-data/data/bedrock/1.18.0/protocol.json +1 -1
  29. package/minecraft-data/data/bedrock/1.18.11/proto.yml +1 -1
  30. package/minecraft-data/data/bedrock/1.18.11/protocol.json +1 -1
  31. package/minecraft-data/data/bedrock/1.18.30/proto.yml +1 -1
  32. package/minecraft-data/data/bedrock/1.18.30/protocol.json +1 -1
  33. package/minecraft-data/data/bedrock/1.19.1/proto.yml +1 -1
  34. package/minecraft-data/data/bedrock/1.19.1/protocol.json +1 -1
  35. package/minecraft-data/data/bedrock/1.19.10/proto.yml +3680 -0
  36. package/minecraft-data/data/bedrock/1.19.10/protocol.json +1 -1
  37. package/minecraft-data/data/bedrock/1.19.10/types.yml +1955 -0
  38. package/minecraft-data/data/bedrock/1.19.20/protocol.json +10644 -0
  39. package/minecraft-data/data/bedrock/1.19.20/version.json +6 -0
  40. package/minecraft-data/data/bedrock/common/protocolVersions.json +6 -0
  41. package/minecraft-data/data/bedrock/common/versions.json +2 -1
  42. package/minecraft-data/data/bedrock/latest/proto.yml +55 -7
  43. package/minecraft-data/data/bedrock/latest/types.yml +7 -0
  44. package/minecraft-data/data/dataPaths.json +22 -1
  45. package/minecraft-data/data/pc/1.19/protocol.json +1 -5
  46. package/minecraft-data/data/pc/1.7/protocol.json +1 -1
  47. package/minecraft-data/data/pc/1.8/protocol.json +1 -1
  48. package/minecraft-data/data/pc/15w40b/protocol.json +1 -1
  49. package/minecraft-data/data/pc/common/protocolVersions.json +35 -0
  50. package/minecraft-data/doc/history.md +14 -0
  51. package/package.json +1 -1
  52. package/typings/generate-typings.js +22 -14
  53. package/typings/index-template.d.ts +160 -133
  54. package/typings/test-typings.ts +24 -29
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 544,
3
+ "minecraftVersion": "1.19.20",
4
+ "majorVersion": "1.19",
5
+ "releaseType": "release"
6
+ }
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": 544,
4
+ "minecraftVersion": "1.19.20",
5
+ "majorVersion": "1.19",
6
+ "releaseType": "release"
7
+ },
2
8
  {
3
9
  "version": 534,
4
10
  "minecraftVersion": "1.19.10",
@@ -13,5 +13,6 @@
13
13
  "1.18.11",
14
14
  "1.18.30",
15
15
  "1.19.1",
16
- "1.19.10"
16
+ "1.19.10",
17
+ "1.19.20"
17
18
  ]
@@ -1,7 +1,7 @@
1
1
  # Created from MiNET and gophertunnel docs
2
2
  # The version below is the latest version this protocol schema was updated for.
3
3
  # The output protocol.json will be in the folder for the version
4
- !version: 1.19.10
4
+ !version: 1.19.20
5
5
 
6
6
  # Some ProtoDef aliases
7
7
  string: ["pstring",{"countType":"varint"}] # String / array types
@@ -334,6 +334,10 @@ packet_start_game:
334
334
  # A hack that Mojang put in place to preserve backwards compatibility with old villagers.
335
335
  # The his never actually read though, so it has no functionality.
336
336
  only_spawn_v1_villagers: bool
337
+ # PersonaDisabled is true if persona skins are disabled for the current game session.
338
+ persona_disabled: bool
339
+ # CustomSkinsDisabled is true if custom skins are disabled for the current game session.
340
+ custom_skins_disabled: bool
337
341
  # The version of the game from which Vanilla features will be used.
338
342
  # The exact function of this field isn't clear.
339
343
  game_version: string
@@ -342,6 +346,13 @@ packet_start_game:
342
346
  is_new_nether: bool
343
347
  edu_resource_uri: EducationSharedResourceURI
344
348
  experimental_gameplay_override: bool
349
+ # ChatRestrictionLevel specifies the level of restriction on in-game chat.
350
+ chat_restriction_level: u8 =>
351
+ 0: none
352
+ 1: dropped
353
+ 2: disabled
354
+ # DisablePlayerInteractions is true if the client should ignore other players when interacting with the world.
355
+ disable_player_interactions: bool
345
356
  # A base64 encoded world ID that is used to identify the world.
346
357
  level_id: string
347
358
  # The name of the world that the player is joining. Note that this field shows up
@@ -407,6 +418,9 @@ packet_start_game:
407
418
  # WorldTemplateID is a UUID that identifies the template that was used to generate the world. Servers that do not
408
419
  # use a world based off of a template can set this to an empty UUID.
409
420
  world_template_id: uuid
421
+ # ClientSideGeneration is true if the client should use the features registered in the FeatureRegistry packet to
422
+ # generate terrain client-side to save on bandwidth.
423
+ client_side_generation: bool
410
424
 
411
425
  packet_add_player:
412
426
  !id: 0x0c
@@ -1047,7 +1061,7 @@ packet_set_entity_data:
1047
1061
  !bound: both
1048
1062
  runtime_entity_id: varint64
1049
1063
  metadata: MetadataDictionary
1050
- tick: varint
1064
+ tick: varint64
1051
1065
 
1052
1066
  # SetActorMotion is sent by the server to change the client-side velocity of an entity. It is usually used
1053
1067
  # in combination with server-side movement calculation.
@@ -1475,6 +1489,8 @@ packet_clientbound_map_item_data:
1475
1489
  # LockedMap specifies if the map that was updated was a locked map, which may be done using a cartography
1476
1490
  # table.
1477
1491
  locked: bool
1492
+ # Origin is the center position of the map being updated.
1493
+ origin: BlockCoordinates
1478
1494
  # The following fields apply only for the MapUpdateFlagInitialisation.
1479
1495
  # MapsIncludedIn holds an array of map IDs that the map updated is included in. This has to do with the
1480
1496
  # scale of the map: Each map holds its own map ID and all map IDs of maps that include this map and have
@@ -1519,6 +1535,11 @@ packet_map_info_request:
1519
1535
  !id: 0x44
1520
1536
  !bound: both
1521
1537
  map_id: zigzag64
1538
+ # ClientPixels is a map of pixels sent from the client to notify the server about the pixels that it isn't
1539
+ # aware of.
1540
+ client_pixels: []lu32
1541
+ rgba: li32
1542
+ index: lu16
1522
1543
 
1523
1544
  # RequestChunkRadius is sent by the client to the server to update the server on the chunk view radius that
1524
1545
  # it has set in the settings. The server may respond with a ChunkRadiusUpdated packet with either the chunk
@@ -2226,11 +2247,21 @@ packet_modal_form_response:
2226
2247
  # FormID is the form ID of the form the client has responded to. It is the same as the ID sent in the
2227
2248
  # ModalFormRequest, and may be used to identify which form was submitted.
2228
2249
  form_id: varint
2229
- # ResponseData is a JSON encoded value representing the response of the player. If the form was
2230
- # cancelled, a JSON encoded 'null' is in the response. For a modal form, the response is either true or
2231
- # false, for a menu form, the response is an integer specifying the index of the button clicked, and for
2232
- # a custom form, the response is an array containing a value for each element.
2233
- data: string
2250
+ # HasResponseData is true if the client provided response data.
2251
+ has_response_data: bool
2252
+ # ResponseData is a JSON encoded value representing the response of the player. For a modal form, the response is
2253
+ # either true or false, for a menu form, the response is an integer specifying the index of the button clicked, and
2254
+ # for a custom form, the response is an array containing a value for each element.
2255
+ data: has_response_data ?
2256
+ if true: string
2257
+ # HasCancelReason is true if the client provided a reason for the form being cancelled.
2258
+ has_cancel_reason: bool
2259
+ # CancelReason represents the reason why the form was cancelled.
2260
+ _: has_cancel_reason ?
2261
+ if true:
2262
+ cancel_reason: u8 =>
2263
+ 0: closed
2264
+ 1: busy
2234
2265
 
2235
2266
  # ServerSettingsRequest is sent by the client to request the settings specific to the server. These settings
2236
2267
  # are shown in a separate tab client-side, and have the same structure as a custom form.
@@ -2540,6 +2571,12 @@ packet_network_chunk_publisher_update:
2540
2571
  # Unlike the RequestChunkRadius and ChunkRadiusUpdated packets, this radius is in blocks rather than
2541
2572
  # chunks, so the chunk radius needs to be multiplied by 16. (Or shifted to the left by 4.)
2542
2573
  radius: varint
2574
+ saved_chunks: []lu32
2575
+ # ChunkX is the X coordinate of the chunk sent. (To translate a block's X to a chunk's X: x >> 4)
2576
+ x: zigzag32
2577
+ # ChunkZ is the Z coordinate of the chunk sent. (To translate a block's Z to a chunk's Z: z >> 4)
2578
+ z: zigzag32
2579
+
2543
2580
 
2544
2581
  # BiomeDefinitionList is sent by the server to let the client know all biomes that are available and
2545
2582
  # implemented on the server side. It is much like the AvailableActorIdentifiers packet, but instead
@@ -3678,3 +3715,14 @@ packet_editor_network:
3678
3715
  !bound: client
3679
3716
  # Payload is a network little endian compound tag holding data relevant to the editor.
3680
3717
  payload: nbt
3718
+
3719
+ # FeatureRegistry is a packet used to notify the client about the world generation features the server is currently
3720
+ # using. This is used in combination with the client-side world generation system introduced in v1.19.20, allowing the
3721
+ # client to completely generate the chunks of the world without having to rely on the server.
3722
+ packet_feature_registry:
3723
+ !id: 0xbf
3724
+ !bound: client
3725
+ # Features is a slice of all registered world generation features.
3726
+ features: []varint
3727
+ name: string
3728
+ options: string
@@ -468,6 +468,13 @@ PlayerAttributes: []varint
468
468
  current: lf32
469
469
  default: lf32
470
470
  name: string
471
+ modifiers: []varint
472
+ id: string
473
+ name: string
474
+ amount: lf32
475
+ operation: li32
476
+ operand: li32
477
+ serializable: bool
471
478
 
472
479
  # UseItemTransactionData represents an inventory transaction data object sent when the client uses an item on
473
480
  # a block. Also used in PlayerAuthoritativeInput packet
@@ -1362,9 +1362,30 @@
1362
1362
  "steve": "bedrock/1.16.201",
1363
1363
  "blocksB2J": "bedrock/1.19.1",
1364
1364
  "blocksJ2B": "bedrock/1.19.1",
1365
+ "proto": "bedrock/1.19.10",
1366
+ "types": "bedrock/1.19.10",
1367
+ "version": "bedrock/1.19.10"
1368
+ },
1369
+ "1.19.20": {
1370
+ "blocks": "bedrock/1.19.1",
1371
+ "blockStates": "bedrock/1.19.1",
1372
+ "blockCollisionShapes": "bedrock/1.19.1",
1373
+ "biomes": "bedrock/1.19.1",
1374
+ "entities": "bedrock/1.19.1",
1375
+ "items": "bedrock/1.19.10",
1376
+ "recipes": "bedrock/1.19.10",
1377
+ "instruments": "bedrock/1.17.0",
1378
+ "materials": "pc/1.17",
1379
+ "enchantments": "pc/1.17",
1380
+ "effects": "pc/1.17",
1381
+ "protocol": "bedrock/1.19.20",
1382
+ "windows": "bedrock/1.16.201",
1383
+ "steve": "bedrock/1.16.201",
1384
+ "blocksB2J": "bedrock/1.19.1",
1385
+ "blocksJ2B": "bedrock/1.19.1",
1365
1386
  "proto": "bedrock/latest",
1366
1387
  "types": "bedrock/latest",
1367
- "version": "bedrock/1.19.10"
1388
+ "version": "bedrock/1.19.20"
1368
1389
  }
1369
1390
  }
1370
1391
  }
@@ -2819,10 +2819,6 @@
2819
2819
  "name": "locked",
2820
2820
  "type": "bool"
2821
2821
  },
2822
- {
2823
- "name": "trackingPosition",
2824
- "type": "bool"
2825
- },
2826
2822
  {
2827
2823
  "name": "icons",
2828
2824
  "type": [
@@ -3578,7 +3574,7 @@
3578
3574
  [
3579
3575
  {
3580
3576
  "name": "dimension",
3581
- "type": "nbt"
3577
+ "type": "string"
3582
3578
  },
3583
3579
  {
3584
3580
  "name": "worldName",
@@ -1299,7 +1299,7 @@
1299
1299
  "container",
1300
1300
  [
1301
1301
  {
1302
- "name": "UUID",
1302
+ "name": "uuid",
1303
1303
  "type": "UUID"
1304
1304
  },
1305
1305
  {
@@ -1278,7 +1278,7 @@
1278
1278
  "container",
1279
1279
  [
1280
1280
  {
1281
- "name": "UUID",
1281
+ "name": "uuid",
1282
1282
  "type": "UUID"
1283
1283
  },
1284
1284
  {
@@ -1240,7 +1240,7 @@
1240
1240
  "container",
1241
1241
  [
1242
1242
  {
1243
- "name": "UUID",
1243
+ "name": "uuid",
1244
1244
  "type": "UUID"
1245
1245
  },
1246
1246
  {
@@ -1,4 +1,39 @@
1
1
  [
2
+ {
3
+ "minecraftVersion": "1.19.2",
4
+ "version": 760,
5
+ "dataVersion": 3120,
6
+ "usesNetty": true,
7
+ "majorVersion": "1.19"
8
+ },
9
+ {
10
+ "minecraftVersion": "1.19.2-rc2",
11
+ "version": 1073741927,
12
+ "dataVersion": 3119,
13
+ "usesNetty": true,
14
+ "majorVersion": "1.19"
15
+ },
16
+ {
17
+ "minecraftVersion": "1.19.2-rc1",
18
+ "version": 1073741926,
19
+ "dataVersion": 3118,
20
+ "usesNetty": true,
21
+ "majorVersion": "1.19"
22
+ },
23
+ {
24
+ "minecraftVersion": "1.19.1",
25
+ "version": 760,
26
+ "dataVersion": 3117,
27
+ "usesNetty": true,
28
+ "majorVersion": "1.19"
29
+ },
30
+ {
31
+ "minecraftVersion": "1.19.1-rc3",
32
+ "version": 1073741925,
33
+ "dataVersion": 3116,
34
+ "usesNetty": true,
35
+ "majorVersion": "1.19"
36
+ },
2
37
  {
3
38
  "minecraftVersion": "1.19.1-rc2",
4
39
  "version": 1073741924,
@@ -1,4 +1,18 @@
1
+ ## 3.10.2
2
+ * bedrock: fix 1.19.20 map data packet
3
+
4
+ ## 3.10.1
5
+ * node-minecraft-data release
6
+
7
+ ## 3.10.0
8
+ * bedrock: add protocol data for 1.19.20 (@stevarino)
9
+
10
+ ## 3.9.1
11
+
12
+ * pc: fix packet_respawn (@rob9315)
13
+
1
14
  ## 3.9.0
15
+
2
16
  * bedrock: Add bedrock 1.19 data (#600)
3
17
  * bedrock: protocol corrections
4
18
  * pc: Add 1.19.1-rc2 to protocol versions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-data",
3
- "version": "3.9.0",
3
+ "version": "3.10.2",
4
4
  "description": "Provide easy access to minecraft data in node.js",
5
5
  "main": "index.js",
6
6
  "tonicExampleFilename": "example.js",
@@ -5,29 +5,37 @@ const fs = require('fs')
5
5
  const templateTypings = fs.readFileSync(path.resolve(__dirname, './index-template.d.ts'), 'utf8')
6
6
 
7
7
  // Recursively get path of all files in a directory
8
- function walkSync (dir, filelist = []) {
8
+ function walkSync (dir, fileList = []) {
9
9
  const files = fs.readdirSync(dir)
10
- files.forEach(function (file) {
10
+ files.forEach((file) => {
11
11
  if (fs.statSync(path.join(dir, file)).isDirectory()) {
12
- filelist = walkSync(path.join(dir, file), filelist)
12
+ fileList = walkSync(path.join(dir, file), fileList)
13
13
  } else {
14
- filelist.push(path.join(dir, file))
14
+ fileList.push(path.join(dir, file))
15
15
  }
16
16
  })
17
- return filelist
17
+ return fileList
18
18
  }
19
19
 
20
20
  async function generate () {
21
21
  let typingString = 'declare namespace MinecraftData {\n\n'
22
- typingString += (await Promise.all(walkSync(path.resolve(__dirname, '../minecraft-data/schemas')).map(async (schemaPath) => {
23
- if (schemaPath.includes('protocol_types')) return
24
- return (await compileFromFile(schemaPath, {
25
- bannerComment: ''
26
- // declareExternallyReferenced: false
27
- })).replace(/export /g, '')
28
- }))).join('\n\n').split('\n').map(line => ' ' + line).join('\n')
22
+ typingString += (
23
+ await Promise.all(
24
+ walkSync(path.resolve(__dirname, '../minecraft-data/schemas')).map(async (schemaPath) => {
25
+ if (schemaPath.includes('protocol_types')) return
26
+ return (await compileFromFile(schemaPath, { bannerComment: '' })).replace(/export /g, '')
27
+ })
28
+ )
29
+ )
30
+ .join('\n\n')
31
+ .split('\n')
32
+ .map((line) => ' ' + line)
33
+ .join('\n')
29
34
 
30
- typingString += templateTypings.split('\n').map(line => ' ' + line).join('\n')
35
+ typingString += templateTypings
36
+ .split('\n')
37
+ .map((line) => ' ' + line)
38
+ .join('\n')
31
39
  typingString += '\n}\n\n' // Close namespace
32
40
  typingString += 'declare function MinecraftData(version: string | number): MinecraftData.IndexedData;\n'
33
41
  typingString += 'export = MinecraftData'
@@ -37,4 +45,4 @@ async function generate () {
37
45
 
38
46
  generate()
39
47
  .then(() => console.log('Generated index.d.ts'))
40
- .catch(e => { console.error(e.stack) })
48
+ .catch((err) => console.error(err.stack))