minecraft-data 2.117.1 → 2.119.1

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.
package/doc/history.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 2.119.1
2
+ * Alias versions that end in .0 to a version without the ending .0
3
+
4
+ ## 2.119.0
5
+ * update mcdata
6
+
7
+ ## 2.118.0
8
+ * update mcdata
9
+
1
10
  ## 2.117.1
2
11
  * Add support for custom supportFeature return type
3
12
 
package/index.js CHANGED
@@ -14,8 +14,8 @@ const types = ['pc', 'bedrock']
14
14
  types.forEach(function (type) {
15
15
  for (let i = 0; i < protocolVersions[type].length; i++) {
16
16
  if (!protocolVersions[type][i].dataVersion) {
17
- // We start top to bottom, so the ones at the bottom should be greater
18
- protocolVersions[type][i].dataVersion = -protocolVersions[type].length + i
17
+ // We start top to bottom, so the ones at the bottom should be lower
18
+ protocolVersions[type][i].dataVersion = -i
19
19
  }
20
20
  }
21
21
  versionsByMinecraftVersion[type] = indexer.buildIndexFromArray(protocolVersions[type], 'minecraftVersion')
@@ -27,9 +27,12 @@ types.forEach(function (type) {
27
27
  function Version (type, version, majorVersion) {
28
28
  const versions = versionsByMinecraftVersion[type]
29
29
  // Allows comparisons against majorVersion even if `other` is not present in the versions.json (e.g. 1.17.0 exists but not 1.17)
30
- for (const version in versions) {
31
- const ver = versions[version]
32
- versions[ver.majorVersion] = versions[ver.majorVersion] || ver
30
+ for (const majorMinorPatchVersion in versions) {
31
+ const versionObj = versions[majorMinorPatchVersion]
32
+ // 1.17.0 === 1.17, so let's add explicit logic for that
33
+ if (versionObj.minecraftVersion.endsWith('.0')) {
34
+ versions[versionObj.majorVersion] = versionObj
35
+ }
33
36
  }
34
37
 
35
38
  this.dataVersion = versions[version]?.dataVersion
@@ -1,40 +1,25 @@
1
1
  [
2
2
  {
3
- "version": 100,
4
- "minecraftVersion": "1.0.0",
5
- "majorVersion": "1.0"
6
- },
7
- {
8
- "version": 82,
9
- "minecraftVersion": "0.15.6",
10
- "majorVersion": "0.15"
11
- },
12
- {
13
- "version": 70,
14
- "minecraftVersion": "0.14.3",
15
- "majorVersion": "0.14"
16
- },
17
- {
18
- "version": 422,
19
- "minecraftVersion": "1.16.201",
20
- "majorVersion": "1.16",
3
+ "version": 486,
4
+ "minecraftVersion": "1.18.11",
5
+ "majorVersion": "1.18",
21
6
  "releaseType": "release"
22
7
  },
23
8
  {
24
- "version": 428,
25
- "minecraftVersion": "1.16.210",
26
- "majorVersion": "1.16",
9
+ "version": 475,
10
+ "minecraftVersion": "1.18.0",
11
+ "majorVersion": "1.18",
27
12
  "releaseType": "release"
28
13
  },
29
14
  {
30
- "version": 431,
31
- "minecraftVersion": "1.16.220",
32
- "majorVersion": "1.16",
15
+ "version": 471,
16
+ "minecraftVersion": "1.17.40",
17
+ "majorVersion": "1.17",
33
18
  "releaseType": "release"
34
19
  },
35
20
  {
36
- "version": 440,
37
- "minecraftVersion": "1.17.0",
21
+ "version": 465,
22
+ "minecraftVersion": "1.17.30",
38
23
  "majorVersion": "1.17",
39
24
  "releaseType": "release"
40
25
  },
@@ -45,27 +30,42 @@
45
30
  "releaseType": "release"
46
31
  },
47
32
  {
48
- "version": 465,
49
- "minecraftVersion": "1.17.30",
33
+ "version": 440,
34
+ "minecraftVersion": "1.17.0",
50
35
  "majorVersion": "1.17",
51
36
  "releaseType": "release"
52
37
  },
53
38
  {
54
- "version": 471,
55
- "minecraftVersion": "1.17.40",
56
- "majorVersion": "1.17",
39
+ "version": 431,
40
+ "minecraftVersion": "1.16.220",
41
+ "majorVersion": "1.16",
57
42
  "releaseType": "release"
58
43
  },
59
44
  {
60
- "version": 475,
61
- "minecraftVersion": "1.18.0",
62
- "majorVersion": "1.18",
45
+ "version": 428,
46
+ "minecraftVersion": "1.16.210",
47
+ "majorVersion": "1.16",
63
48
  "releaseType": "release"
64
49
  },
65
50
  {
66
- "version": 486,
67
- "minecraftVersion": "1.18.11",
68
- "majorVersion": "1.18",
51
+ "version": 422,
52
+ "minecraftVersion": "1.16.201",
53
+ "majorVersion": "1.16",
69
54
  "releaseType": "release"
55
+ },
56
+ {
57
+ "version": 100,
58
+ "minecraftVersion": "1.0.0",
59
+ "majorVersion": "1.0"
60
+ },
61
+ {
62
+ "version": 82,
63
+ "minecraftVersion": "0.15.6",
64
+ "majorVersion": "0.15"
65
+ },
66
+ {
67
+ "version": 70,
68
+ "minecraftVersion": "0.14.3",
69
+ "majorVersion": "0.14"
70
70
  }
71
- ]
71
+ ]
@@ -359,5 +359,82 @@
359
359
  "version": "1.8_major"
360
360
  }
361
361
  ]
362
+ },
363
+ {
364
+ "name": "itemSerializationWillOnlyUsePresent",
365
+ "description": "item serialization in [even] newer versions uses present field [exclusively] to show nullability rather than sending blockId as -1",
366
+ "versions": ["1.14_major", "latest"]
367
+ },
368
+ {
369
+ "name": "itemSerializationAllowsPresent",
370
+ "description": "item serialization in newer versions uses present field to show nullability rather or sending blockId as -1 can be used",
371
+ "versions": ["1.13_major", "latest"]
372
+ },
373
+ {
374
+ "name": "itemSerializationUsesBlockId",
375
+ "description": "item serialization in older versions uses blockId field to show nullability by setting blockId to -1",
376
+ "versions": ["1.8_major", "1.12_major"]
377
+ },
378
+ {
379
+ "name": "saveDurabilityAsDamage",
380
+ "description": "in newer versions, an nbt key called 'Damage' is used to store durability",
381
+ "versions": ["1.13_major", "latest"]
382
+ },
383
+ {
384
+ "name": "nbtNameForEnchant",
385
+ "description": "what the nbt key for enchants is",
386
+ "values": [
387
+ {
388
+ "value": "Enchantments",
389
+ "versions": ["1.13_major", "latest"]
390
+ },
391
+ {
392
+ "value": "ench",
393
+ "versions": ["1.8_major", "1.12_major"]
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "name": "typeOfValueForEnchantLevel",
399
+ "description": "type of value that stores enchant lvl in the nbt",
400
+ "values": [
401
+ {
402
+ "value": "string",
403
+ "versions": ["1.13_major", "latest"]
404
+ },
405
+ {
406
+ "value": "short",
407
+ "versions": ["1.8_major", "1.12_major"]
408
+ }
409
+ ]
410
+ },
411
+ {
412
+ "name": "whereDurabilityIsSerialized",
413
+ "description": "where the durability is saved in nbt",
414
+ "values": [
415
+ {
416
+ "value": "Damage",
417
+ "versions": ["1.13_major", "latest"]
418
+ },
419
+ {
420
+ "value": "metadata",
421
+ "versions": ["1.8_major", "1.12_major"]
422
+ }
423
+ ]
424
+ },
425
+ {
426
+ "name": "spawnEggsUseInternalIdInNbt",
427
+ "description": "in older versions, spawn eggs have a field in their nbt called 'internalId' which tells what entity they will spawn",
428
+ "versions": ["1.8_major", "1.8_major"]
429
+ },
430
+ {
431
+ "name": "spawnEggsUseEntityTagInNbt",
432
+ "description": "in older versions, spawn eggs have a key in their nbt called EntityTag which is an object with a field called id, which is an identifier like 'minecraft:cow' that tells the client what mob this egg will spawn",
433
+ "versions": ["1.9_major", "1.12_major"]
434
+ },
435
+ {
436
+ "name": "spawnEggsHaveSpawnedEntityInName",
437
+ "description": "in newer versions, spawn eggs have the entity they spawn in their name, ex: 'squid_spawn_egg'",
438
+ "versions": ["1.13_major", "latest"]
362
439
  }
363
440
  ]
@@ -1,3 +1,9 @@
1
+ ## 2.119.0
2
+ * reverse bedrock version list
3
+
4
+ ## 2.118.0
5
+ * Add prismarine-item features
6
+
1
7
  ## 2.117.0
2
8
  * Add "metadataIxOfItem" feature
3
9
 
@@ -19,7 +19,6 @@
19
19
  "versions": {
20
20
  "description": "A tuple that describes the range of versions in the range",
21
21
  "type": "array",
22
- "uniqueItems": true,
23
22
  "items": {
24
23
  "title": "versionForFeatureIdentification",
25
24
  "type": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-data",
3
- "version": "2.117.1",
3
+ "version": "2.119.1",
4
4
  "description": "Provide easy access to minecraft data in node.js",
5
5
  "main": "index.js",
6
6
  "tonicExampleFilename": "example.js",
package/test/load.js CHANGED
@@ -19,6 +19,15 @@ describe('load', () => {
19
19
 
20
20
  const firstDataVersion = require('minecraft-data')('15w32a') // dataVersion = 100
21
21
  assert.strictEqual(firstDataVersion.isNewerOrEqualTo('15w31c'), true) // no dataVersion
22
+
23
+ const mcData188 = require('minecraft-data')('1.8.8')
24
+ assert.strictEqual(mcData188.isNewerOrEqualTo('1.8'), true, '1.8.8>1.8')
25
+
26
+ const mcDataBedrock1Dot7Dot10 = require('minecraft-data')('bedrock_1.17.10')
27
+ assert.strictEqual(mcDataBedrock1Dot7Dot10.isNewerOrEqualTo('1.17'), true, '1.17.10>1.17')
28
+
29
+ const bedrock16220 = require('minecraft-data')('bedrock_1.16.220')
30
+ assert.strictEqual(bedrock16220.isNewerOrEqualTo('1.16.210'), true, 'bedrock_1.16.220>bedrock_1.16.210')
22
31
  })
23
32
  })
24
33