minecraft-data 3.95.0 → 3.96.0

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.
@@ -16,16 +16,75 @@
16
16
  "type": "string",
17
17
  "pattern": ".+"
18
18
  },
19
+ "version": {
20
+ "description": "Single version where this feature applies",
21
+ "type": "string"
22
+ },
19
23
  "versions": {
20
- "description": "A tuple that describes the range of versions in the range",
24
+ "description": "A tuple that describes the range of versions where this feature applies [minVersion, maxVersion]",
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ },
29
+ "minItems": 2,
30
+ "maxItems": 2,
31
+ "additionalItems": false
32
+ },
33
+ "values": {
34
+ "description": "Version-specific values for features that have different values across versions",
21
35
  "type": "array",
22
36
  "items": {
23
- "title": "versionForFeatureIdentification",
24
- "type": "string",
25
- "minItems": 2,
26
- "additionalItems": false
37
+ "title": "versionSpecificValue",
38
+ "type": "object",
39
+ "properties": {
40
+ "value": {
41
+ "description": "The value for this feature in the specified versions"
42
+ },
43
+ "version": {
44
+ "description": "Single version where this value applies",
45
+ "type": "string"
46
+ },
47
+ "versions": {
48
+ "description": "Version range where this value applies [minVersion, maxVersion]",
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ },
53
+ "minItems": 2,
54
+ "maxItems": 2,
55
+ "additionalItems": false
56
+ }
57
+ },
58
+ "required": ["value"],
59
+ "oneOf": [
60
+ {
61
+ "required": ["version"],
62
+ "not": {"required": ["versions"]}
63
+ },
64
+ {
65
+ "required": ["versions"],
66
+ "not": {"required": ["version"]}
67
+ }
68
+ ],
69
+ "additionalProperties": false
27
70
  }
28
71
  }
29
- }
72
+ },
73
+ "required": ["name", "description"],
74
+ "oneOf": [
75
+ {
76
+ "required": ["version"],
77
+ "not": {"anyOf": [{"required": ["versions"]}, {"required": ["values"]}]}
78
+ },
79
+ {
80
+ "required": ["versions"],
81
+ "not": {"anyOf": [{"required": ["version"]}, {"required": ["values"]}]}
82
+ },
83
+ {
84
+ "required": ["values"],
85
+ "not": {"anyOf": [{"required": ["version"]}, {"required": ["versions"]}]}
86
+ }
87
+ ],
88
+ "additionalProperties": false
30
89
  }
31
90
  }
@@ -41,11 +41,26 @@
41
41
  "type": "integer",
42
42
  "minimum": 0
43
43
  },
44
+ "durability": {
45
+ "description": "durability value for editions that specify it alongside maxDurability",
46
+ "type": "integer",
47
+ "minimum": 0
48
+ },
49
+ "metadata": {
50
+ "description": "legacy data value used in some editions at the item level",
51
+ "type": "integer",
52
+ "minimum": 0
53
+ },
44
54
  "name": {
45
55
  "description": "The name of an item",
46
56
  "type": "string",
47
57
  "pattern": "\\S+"
48
58
  },
59
+ "blockStateId": {
60
+ "description": "Block state id associated with this item in some editions",
61
+ "type": "integer",
62
+ "minimum": 0
63
+ },
49
64
  "variations" : {
50
65
  "type" : "array",
51
66
  "items": {
@@ -57,14 +72,37 @@
57
72
  },
58
73
  "displayName":{
59
74
  "type":"string"
75
+ },
76
+ "id": {
77
+ "description": "The unique identifier for a variation (when applicable)",
78
+ "type": "integer",
79
+ "minimum": 0
80
+ },
81
+ "name": {
82
+ "description": "The name of a variation (when applicable)",
83
+ "type": "string",
84
+ "pattern": "\\S+"
85
+ },
86
+ "stackSize": {
87
+ "description": "Stack size for a variation (when applicable)",
88
+ "type": "integer",
89
+ "minimum": 0
90
+ },
91
+ "enchantCategories": {
92
+ "description": "describes categories of enchants this variation can use",
93
+ "type": "array",
94
+ "uniqueItems": true,
95
+ "items": {
96
+ "type": "string"
97
+ }
60
98
  }
61
99
  },
62
100
  "required": ["metadata", "displayName"],
63
- "additionalProperties": true
101
+ "additionalProperties": false
64
102
  }
65
103
  }
66
104
  },
67
105
  "required": ["id", "displayName", "stackSize", "name"],
68
- "additionalProperties": true
106
+ "additionalProperties": false
69
107
  }
70
108
  }
@@ -1,6 +1,7 @@
1
1
  const fs = require('fs')
2
2
  const { join } = require('path')
3
3
 
4
+ const rootPath = join(__dirname, '..', '..')
4
5
  const data = join(__dirname, '..', '..', 'data')
5
6
 
6
7
  function getJSON (path) {
@@ -19,6 +20,16 @@ function alterJSON (path, callback) {
19
20
  }
20
21
  }
21
22
 
23
+ function bumpReadmeVersion (edition, version) {
24
+ const readmePath = join(rootPath, 'README.md')
25
+ let readmeContents = fs.readFileSync(readmePath, 'utf-8')
26
+ if (!readmeContents.includes(version)) {
27
+ if (edition === 'pc') readmeContents = readmeContents.replace('\n<!--NEXT PC-->', `, ${version}\n<!--NEXT PC-->`)
28
+ if (edition === 'bedrock') readmeContents = readmeContents.replace('\n<!--NEXT BEDROCK-->', `, ${version}\n<!--NEXT BEDROCK-->`)
29
+ }
30
+ fs.writeFileSync(readmePath, readmeContents, 'utf-8')
31
+ }
32
+
22
33
  function updateProtocol (edition, version, protocolVersionNumber) {
23
34
  const dataRoot = join(data, edition)
24
35
  const protocolVersionsPath = join(dataRoot, 'common', 'protocolVersions.json')
@@ -112,3 +123,4 @@ if (platforms[platform] === undefined) {
112
123
  }
113
124
 
114
125
  platforms[platform](platform, version, protocol)
126
+ bumpReadmeVersion(platform, version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-data",
3
- "version": "3.95.0",
3
+ "version": "3.96.0",
4
4
  "description": "Provide easy access to minecraft data in node.js",
5
5
  "main": "index.js",
6
6
  "tonicExampleFilename": "example.js",