minecraft-data 2.100.0 → 2.100.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/api.md +14 -0
- package/doc/history.md +3 -0
- package/example.js +5 -0
- package/index.d.ts +4 -0
- package/lib/indexes.js +5 -1
- package/lib/loader.js +4 -0
- package/package.json +2 -2
- package/typings/index-template.d.ts +4 -0
package/doc/api.md
CHANGED
|
@@ -216,6 +216,20 @@ effects indexed by name
|
|
|
216
216
|
|
|
217
217
|
unindexed effects
|
|
218
218
|
|
|
219
|
+
## Attributes
|
|
220
|
+
|
|
221
|
+
### minecraft-data.attributes
|
|
222
|
+
|
|
223
|
+
attributes indexed by resource name (generic.movementSpeed || minecraft:generic.movement_speed)
|
|
224
|
+
|
|
225
|
+
### minecraft-data.attributesByName
|
|
226
|
+
|
|
227
|
+
attributes indexed by minecraft-data name (movementSpeed)
|
|
228
|
+
|
|
229
|
+
### minecraft-data.attributesArray
|
|
230
|
+
|
|
231
|
+
unindexed attributes
|
|
232
|
+
|
|
219
233
|
## Particles
|
|
220
234
|
|
|
221
235
|
### minecraft-data.particles
|
package/doc/history.md
CHANGED
package/example.js
CHANGED
|
@@ -47,3 +47,8 @@ console.log(require('minecraft-data')('1.16.1').loginPacket)
|
|
|
47
47
|
console.log(require('minecraft-data')('1.16.4').mapIconsByName.player)
|
|
48
48
|
|
|
49
49
|
console.log(require('minecraft-data').legacy.pc.blocks['0:0'])
|
|
50
|
+
|
|
51
|
+
console.log(require('minecraft-data')('1.15.2').attributes['generic.movementSpeed'])
|
|
52
|
+
console.log(require('minecraft-data')('1.16').attributes['minecraft:generic.movement_speed'])
|
|
53
|
+
console.log(require('minecraft-data')('1.15.2').attributesByName.movementSpeed)
|
|
54
|
+
console.log(require('minecraft-data')('1.16').attributesByName.movementSpeed)
|
package/index.d.ts
CHANGED
|
@@ -905,6 +905,10 @@ declare namespace MinecraftData {
|
|
|
905
905
|
effectsByName: { [name: string]: Effect; };
|
|
906
906
|
effectsArray: Effect[];
|
|
907
907
|
|
|
908
|
+
attributes: { [resource: string]: string; };
|
|
909
|
+
attributesByName: { [name: string]: string; };
|
|
910
|
+
attributesArray: [];
|
|
911
|
+
|
|
908
912
|
version: Version;
|
|
909
913
|
|
|
910
914
|
type: string;
|
package/lib/indexes.js
CHANGED
|
@@ -43,6 +43,10 @@ module.exports = function (mcData) {
|
|
|
43
43
|
entityLootByName: indexer.buildIndexFromArray(mcData.entityLoot, 'entity'),
|
|
44
44
|
|
|
45
45
|
mapIconsById: indexer.buildIndexFromArray(mcData.mapIcons, 'id'),
|
|
46
|
-
mapIconsByName: indexer.buildIndexFromArray(mcData.mapIcons, 'name')
|
|
46
|
+
mapIconsByName: indexer.buildIndexFromArray(mcData.mapIcons, 'name'),
|
|
47
|
+
|
|
48
|
+
attributesByName: indexer.buildIndexFromArray(mcData.attributes, 'name'),
|
|
49
|
+
attributesByResource: indexer.buildIndexFromArray(mcData.attributes, 'resource')
|
|
50
|
+
|
|
47
51
|
}
|
|
48
52
|
}
|
package/lib/loader.js
CHANGED
|
@@ -58,6 +58,10 @@ function mcDataToNode (mcData) {
|
|
|
58
58
|
effectsByName: indexes.effectsByName,
|
|
59
59
|
effectsArray: mcData.effects,
|
|
60
60
|
|
|
61
|
+
attributes: indexes.attributesByResource,
|
|
62
|
+
attributesByName: indexes.attributesByName,
|
|
63
|
+
attributesArray: mcData.attributes,
|
|
64
|
+
|
|
61
65
|
particles: indexes.particlesById,
|
|
62
66
|
particlesByName: indexes.particlesByName,
|
|
63
67
|
particlesArray: mcData.particles,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minecraft-data",
|
|
3
|
-
"version": "2.100.
|
|
3
|
+
"version": "2.100.1",
|
|
4
4
|
"description": "Provide easy access to minecraft data in node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"tonicExampleFilename": "example.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/PrismarineJS/node-minecraft-data/issues"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^17.0.2",
|
|
37
37
|
"json-schema-to-typescript": "^10.0.3",
|
|
38
38
|
"minecraft-packets": "^1.4.0",
|
|
39
39
|
"mocha": "^9.0.0",
|
|
@@ -91,6 +91,10 @@ export interface IndexedData {
|
|
|
91
91
|
effectsByName: { [name: string]: Effect; };
|
|
92
92
|
effectsArray: Effect[];
|
|
93
93
|
|
|
94
|
+
attributes: { [resource: string]: string; };
|
|
95
|
+
attributesByName: { [name: string]: string; };
|
|
96
|
+
attributesArray: [];
|
|
97
|
+
|
|
94
98
|
version: Version;
|
|
95
99
|
|
|
96
100
|
type: string;
|