minecraft-data 2.112.0 → 2.113.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.
package/data.js CHANGED
@@ -1223,9 +1223,29 @@ module.exports =
1223
1223
  get steve () { return require("./minecraft-data/data/bedrock/1.16.201/steve.json") },
1224
1224
  get blocksB2J () { return require("./minecraft-data/data/bedrock/1.18.0/blocksB2J.json") },
1225
1225
  get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.18.0/blocksJ2B.json") },
1226
+ proto: __dirname + '/minecraft-data/data/bedrock/1.18.0/proto.yml',
1227
+ types: __dirname + '/minecraft-data/data/bedrock/1.18.0/types.yml',
1228
+ get version () { return require("./minecraft-data/data/bedrock/1.18.0/version.json") }
1229
+ },
1230
+ '1.18.11': {
1231
+ get blocks () { return require("./minecraft-data/data/bedrock/1.17.40/blocks.json") },
1232
+ get blockStates () { return require("./minecraft-data/data/bedrock/1.17.40/blockStates.json") },
1233
+ get blockCollisionShapes () { return require("./minecraft-data/data/bedrock/1.17.40/blockCollisionShapes.json") },
1234
+ get biomes () { return require("./minecraft-data/data/bedrock/1.18.0/biomes.json") },
1235
+ get items () { return require("./minecraft-data/data/bedrock/1.18.0/items.json") },
1236
+ get recipes () { return require("./minecraft-data/data/bedrock/1.18.0/recipes.json") },
1237
+ get instruments () { return require("./minecraft-data/data/bedrock/1.17.0/instruments.json") },
1238
+ get materials () { return require("./minecraft-data/data/pc/1.17/materials.json") },
1239
+ get enchantments () { return require("./minecraft-data/data/pc/1.17/enchantments.json") },
1240
+ get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
1241
+ get protocol () { return require("./minecraft-data/data/bedrock/1.18.11/protocol.json") },
1242
+ get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
1243
+ get steve () { return require("./minecraft-data/data/bedrock/1.16.201/steve.json") },
1244
+ get blocksB2J () { return require("./minecraft-data/data/bedrock/1.18.0/blocksB2J.json") },
1245
+ get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.18.0/blocksJ2B.json") },
1226
1246
  proto: __dirname + '/minecraft-data/data/bedrock/latest/proto.yml',
1227
1247
  types: __dirname + '/minecraft-data/data/bedrock/latest/types.yml',
1228
- get version () { return require("./minecraft-data/data/bedrock/1.18.0/version.json") }
1248
+ get version () { return require("./minecraft-data/data/bedrock/1.18.11/version.json") }
1229
1249
  }
1230
1250
  }
1231
1251
  }
package/doc/api.md CHANGED
@@ -68,6 +68,10 @@ biomes indexed by id
68
68
 
69
69
  unindexed biomes
70
70
 
71
+ ### minecraft-data.biomesByName
72
+
73
+ biomes object indexed by name
74
+
71
75
  ## Recipes
72
76
 
73
77
  ### minecraft-data.recipes
package/doc/history.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 2.113.2
2
+ * update mcdata
3
+
4
+ ## 2.113.1
5
+ * update mcdata
6
+
7
+ ## 2.113.1
8
+ * Add block state IDs to all versions with block data
9
+
10
+ ## 2.113.0
11
+ * update mcdata
12
+
1
13
  ## 2.112.0
2
14
  * update mcdata
3
15
 
package/index.d.ts CHANGED
@@ -875,6 +875,7 @@ declare namespace MinecraftData {
875
875
 
876
876
  biomes: { [id: number]: Biome; };
877
877
  biomesArray: Biome[];
878
+ biomesByName: { [name: string]: Biome; };
878
879
 
879
880
  recipes: { [id: number]: Recipe[]; };
880
881
 
package/lib/indexes.js CHANGED
@@ -1,6 +1,16 @@
1
1
  const indexer = require('./indexer.js')
2
2
 
3
3
  module.exports = function (mcData) {
4
+ if (mcData.blocks?.length) {
5
+ if (!('minStateId' in mcData.blocks[0]) || !('defaultState' in mcData.blocks[0])) {
6
+ for (const block of mcData.blocks) {
7
+ block.minStateId = block.id << 4
8
+ block.maxStateId = block.minStateId + 15
9
+ block.defaultState = block.minStateId
10
+ }
11
+ }
12
+ }
13
+
4
14
  return {
5
15
  biomesById: indexer.buildIndexFromArray(mcData.biomes, 'id'),
6
16
  biomesByName: indexer.buildIndexFromArray(mcData.biomes, 'name'),
@@ -23,6 +23,7 @@ Minecraft-data is language independent, you can use it with these language speci
23
23
  | [McData](https://github.com/McEx/McData) | Elixir | protocol |
24
24
  | [ProtocolGen](https://github.com/Johni0702/ProtocolGen) | java | generated java files from protocol.json to read and write minecraft packets |
25
25
  | [mcdata](https://github.com/wlwanpan/mcdata) | Go | everything |
26
+ | [minecraft-data-rs](https://github.com/Trivernis/minecraft-data-rs) | Rust | everything |
26
27
 
27
28
  If you want to use minecraft-data in a new language, we advise you to [create a new wrapper](doc/make-a-new-wrapper.md)
28
29