minecraft-data 3.95.1 → 3.97.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.
package/data.js CHANGED
@@ -1584,7 +1584,7 @@ module.exports =
1584
1584
  get tints () { return require("./minecraft-data/data/pc/1.21.5/tints.json") },
1585
1585
  get version () { return require("./minecraft-data/data/pc/1.21.5/version.json") },
1586
1586
  get windows () { return require("./minecraft-data/data/pc/1.16.1/windows.json") },
1587
- proto: __dirname + '/minecraft-data/data/pc/latest/proto.yml'
1587
+ proto: __dirname + '/minecraft-data/data/pc/1.21.5/proto.yml'
1588
1588
  },
1589
1589
  '1.21.6': {
1590
1590
  get attributes () { return require("./minecraft-data/data/pc/1.21.6/attributes.json") },
@@ -1605,7 +1605,7 @@ module.exports =
1605
1605
  get mapIcons () { return require("./minecraft-data/data/pc/1.20.2/mapIcons.json") },
1606
1606
  get materials () { return require("./minecraft-data/data/pc/1.21.6/materials.json") },
1607
1607
  get particles () { return require("./minecraft-data/data/pc/1.21.6/particles.json") },
1608
- get protocol () { return require("./minecraft-data/data/pc/1.21.5/protocol.json") },
1608
+ get protocol () { return require("./minecraft-data/data/pc/1.21.6/protocol.json") },
1609
1609
  get recipes () { return require("./minecraft-data/data/pc/1.21.6/recipes.json") },
1610
1610
  get sounds () { return require("./minecraft-data/data/pc/1.21.6/sounds.json") },
1611
1611
  get tints () { return require("./minecraft-data/data/pc/1.21.6/tints.json") },
package/doc/history.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # History
2
2
 
3
+ ## 3.97.0
4
+
5
+ * update `minecraft-data`
6
+
7
+ ## 3.96.0
8
+
9
+ * update `minecraft-data`
10
+
3
11
  ## 3.95.1
4
12
 
5
13
  * update `minecraft-data`
package/index.d.ts CHANGED
@@ -48,13 +48,13 @@ declare namespace MinecraftData {
48
48
  /**
49
49
  * The type of precipitation: none, rain or snow [before 1.19.4]
50
50
  */
51
- precipitation?: string;
51
+ precipitation?: "none" | "rain" | "snow";
52
52
  /**
53
53
  * True if a biome has any precipitation (rain or snow) [1.19.4+]
54
54
  */
55
55
  has_precipitation?: boolean;
56
56
  /**
57
- * The dimension of a biome: overworld, nether or end
57
+ * The dimension of a biome: overworld, nether, end, or the_end (bedrock)
58
58
  */
59
59
  dimension: string;
60
60
  /**
@@ -69,7 +69,73 @@ declare namespace MinecraftData {
69
69
  * How much rain there is in a biome [before 1.19.4]
70
70
  */
71
71
  rainfall?: number;
72
- [k: string]: unknown;
72
+ /**
73
+ * The depth/height variation of the biome terrain
74
+ */
75
+ depth?: number;
76
+ /**
77
+ * Climate data for the biome
78
+ *
79
+ * @minItems 1
80
+ */
81
+ climates?: [
82
+ {
83
+ /**
84
+ * Climate temperature value
85
+ */
86
+ temperature: number;
87
+ /**
88
+ * Climate humidity value
89
+ */
90
+ humidity: number;
91
+ /**
92
+ * Climate altitude value
93
+ */
94
+ altitude: number;
95
+ /**
96
+ * Climate weirdness value
97
+ */
98
+ weirdness: number;
99
+ /**
100
+ * Climate offset value
101
+ */
102
+ offset: number;
103
+ },
104
+ ...{
105
+ /**
106
+ * Climate temperature value
107
+ */
108
+ temperature: number;
109
+ /**
110
+ * Climate humidity value
111
+ */
112
+ humidity: number;
113
+ /**
114
+ * Climate altitude value
115
+ */
116
+ altitude: number;
117
+ /**
118
+ * Climate weirdness value
119
+ */
120
+ weirdness: number;
121
+ /**
122
+ * Climate offset value
123
+ */
124
+ offset: number;
125
+ }[]
126
+ ];
127
+ /**
128
+ * Legacy name of the biome used in older versions
129
+ */
130
+ name_legacy?: string;
131
+ /**
132
+ * Parent biome name for variant biomes
133
+ */
134
+ parent?: string;
135
+ /**
136
+ * Child biome ID for variant biomes
137
+ */
138
+ child?: number;
73
139
  }
74
140
 
75
141
 
@@ -414,7 +480,6 @@ declare namespace MinecraftData {
414
480
  * Can this enchantment be discovered
415
481
  */
416
482
  discoverable: boolean;
417
- [k: string]: unknown;
418
483
  }
419
484
 
420
485
 
@@ -604,16 +669,42 @@ declare namespace MinecraftData {
604
669
  * the amount of durability an item has before being damaged/used
605
670
  */
606
671
  maxDurability?: number;
672
+ /**
673
+ * durability value for editions that specify it alongside maxDurability
674
+ */
675
+ durability?: number;
676
+ /**
677
+ * legacy data value used in some editions at the item level
678
+ */
679
+ metadata?: number;
607
680
  /**
608
681
  * The name of an item
609
682
  */
610
683
  name: string;
684
+ /**
685
+ * Block state id associated with this item in some editions
686
+ */
687
+ blockStateId?: number;
611
688
  variations?: {
612
689
  metadata: number;
613
690
  displayName: string;
614
- [k: string]: unknown;
691
+ /**
692
+ * The unique identifier for a variation (when applicable)
693
+ */
694
+ id?: number;
695
+ /**
696
+ * The name of a variation (when applicable)
697
+ */
698
+ name?: string;
699
+ /**
700
+ * Stack size for a variation (when applicable)
701
+ */
702
+ stackSize?: number;
703
+ /**
704
+ * describes categories of enchants this variation can use
705
+ */
706
+ enchantCategories?: string[];
615
707
  }[];
616
- [k: string]: unknown;
617
708
  }
618
709
 
619
710
 
@@ -1253,13 +1344,13 @@ declare namespace MinecraftData {
1253
1344
  "saveDurabilityAsDamage": boolean;
1254
1345
  /**
1255
1346
  * what the nbt key for enchants is */
1256
- "nbtNameForEnchant": "componentEnchantments" | "Enchantments" | "ench";
1347
+ "nbtNameForEnchant": "Enchantments" | "ench";
1257
1348
  /** `1.8_major - latest`
1258
1349
  * Enchanted books store enchantment data in a separate NBT tag called StoredEnchantments */
1259
1350
  "booksUseStoredEnchantments": boolean;
1260
1351
  /**
1261
1352
  * type of value that stores enchant lvl in the nbt */
1262
- "typeOfValueForEnchantLevel": "short";
1353
+ "typeOfValueForEnchantLevel": "string" | "short";
1263
1354
  /**
1264
1355
  * where the durability is saved in nbt */
1265
1356
  "whereDurabilityIsSerialized": "Damage" | "metadata";
@@ -1383,6 +1474,9 @@ declare namespace MinecraftData {
1383
1474
  /** `1.21.5 - latest`
1384
1475
  * chatGlobalIndexAndChecksum */
1385
1476
  "chatGlobalIndexAndChecksum": boolean;
1477
+ /** `1.21.6 - latest`
1478
+ * entity_action packet uses string mappings instead of numeric actionId */
1479
+ "entityActionUsesStringMapper": boolean;
1386
1480
  }
1387
1481
 
1388
1482
  type Object = { [key: string]: any }
@@ -1,10 +1,11 @@
1
1
  const fs = require('fs')
2
2
  const cp = require('child_process')
3
- const helper = require('gh-helpers')()
3
+ const github = require('gh-helpers')()
4
+ const exec = (cmd) => github.mock ? console.log('> ', cmd) : (console.log('> ', cmd), cp.execSync(cmd, { stdio: 'inherit' }))
4
5
  const pcManifestURL = 'https://launchermeta.mojang.com/mc/game/version_manifest.json'
5
6
  const changelogURL = 'https://feedback.minecraft.net/hc/en-us/sections/360001186971-Release-Changelogs'
6
7
 
7
- const download = (url, dest) => cp.execSync(`curl -L ${url} -o ${dest}`)
8
+ const download = (url, dest) => exec(`curl -L ${url} -o ${dest}`)
8
9
 
9
10
  function buildFirstIssue (title, result, jarData) {
10
11
  const protocolVersion = jarData?.protocol_version || 'Failed to obtain from JAR'
@@ -33,6 +34,21 @@ A new Minecraft Java Edition version is available (as of ${date}), version **${r
33
34
  }
34
35
  }
35
36
 
37
+ async function createInitialPull (edition, issueUrl, { version, protocolVersion }) {
38
+ exec('cd tools/js && npm install')
39
+ exec(`cd tools/js && npm run version ${edition} ${version} ${protocolVersion}`)
40
+ const branchNameVersion = version.replace(/[^a-zA-Z0-9]/g, '.').toLowerCase()
41
+ const branchName = `${edition}-${branchNameVersion}`
42
+ const title = `Initial data for ${edition} ${version}`
43
+ exec(`git checkout -b ${branchName}`)
44
+ exec(`git add --all`)
45
+ exec(`git commit -m "${title}"`)
46
+ exec(`git push origin ${branchName}`)
47
+ // createPullRequest(title: string, body: string, fromBranch: string, intoBranch?: string): Promise<{ number: number, url: string }>;
48
+ const pr = await github.createPullRequest(title, `${title}.\n\nRef: ${issueUrl}`, branchName, 'master')
49
+ return pr
50
+ }
51
+
36
52
  const protocolVersions = {
37
53
  pc: require('../../data/pc/common/protocolVersions.json'),
38
54
  bedrock: require('../../data/bedrock/common/protocolVersions.json')
@@ -51,7 +67,7 @@ async function updateManifestPC () {
51
67
  const latestVersionIsSnapshot = latestVersionData.type !== 'release'
52
68
 
53
69
  const title = `Support Minecraft PC ${latestVersion}`
54
- const issueStatus = await helper.findIssue({ titleIncludes: title }) || {}
70
+ const issueStatus = await github.findIssue({ titleIncludes: title }) || {}
55
71
 
56
72
  if (latestVersionIsSnapshot) {
57
73
  // don't make issues for snapshots
@@ -62,7 +78,7 @@ async function updateManifestPC () {
62
78
  } else {
63
79
  if (supportedVersions.pc.includes(latestVersion)) {
64
80
  if (issueStatus.isOpen) {
65
- helper.close(issueStatus.id, `Closing as PC ${latestVersion} is now supported`)
81
+ github.close(issueStatus.id, `Closing as PC ${latestVersion} is now supported`)
66
82
  }
67
83
  console.log('Latest PC version is supported.')
68
84
  return
@@ -85,7 +101,7 @@ async function updateManifestPC () {
85
101
  } else {
86
102
  console.log('Latest PC version is not supported and we failed to load data. Opening issue...')
87
103
  const issuePayload = buildFirstIssue(title, latestVersionData)
88
- helper.createIssue(issuePayload)
104
+ github.createIssue(issuePayload)
89
105
 
90
106
  fs.writeFileSync('./issue.md', issuePayload.body)
91
107
  console.log('OK, wrote to ./issue.md', issuePayload)
@@ -96,10 +112,30 @@ async function updateManifestPC () {
96
112
  console.log('Opening issue', versionJson)
97
113
  const issuePayload = buildFirstIssue(title, latestVersionData, versionJson)
98
114
 
99
- helper.createIssue(issuePayload)
115
+ const issue = await github.createIssue(issuePayload)
100
116
 
101
117
  fs.writeFileSync('./issue.md', issuePayload.body)
102
- console.log('OK, wrote to ./issue.md', issuePayload)
118
+ console.log('Created issue', issue)
119
+
120
+ // Now create an initial PR with the new version data
121
+ const pr = await createInitialPull('pc', issue.url, {
122
+ minecraftVersion: versionJson.id,
123
+ version: latestVersion,
124
+ protocolVersion: versionJson.protocol_version
125
+ })
126
+ console.log('Created PR', pr)
127
+ // Ask minecraft-data-generator to handle new update
128
+ const dispatchPayload = {
129
+ owner: 'PrismarineJS',
130
+ repo: 'minecraft-data-generator',
131
+ workflow: 'handle-mcdata-update.yml',
132
+ branch: 'main',
133
+ inputs: {
134
+ version: latestVersion
135
+ }
136
+ }
137
+ console.log('Sending workflow dispatch', dispatchPayload)
138
+ await github.sendWorkflowDispatch(dispatchPayload)
103
139
  }
104
140
 
105
141
  async function addEntryFor (releaseVersion, releaseData) {
@@ -10,7 +10,9 @@ Language independent module providing minecraft data for minecraft clients, serv
10
10
  Supports
11
11
  * Minecraft PC version 0.30c (classic), 1.7.10, 1.8.8, 1.9 (15w40b, 1.9, 1.9.1-pre2, 1.9.2, 1.9.4),
12
12
  1.10 (16w20a, 1.10-pre1, 1.10, 1.10.1, 1.10.2), 1.11 (16w35a, 1.11, 1.11.2), 1.12 (17w15a, 17w18b, 1.12-pre4, 1.12, 1.12.1, 1.12.2), 1.13 (17w50a, 1.13, 1.13.1, 1.13.2-pre1, 1.13.2-pre2, 1.13.2), 1.14 (1.14, 1.14.1, 1.14.3, 1.14.4), 1.15 (1.15, 1.15.1, 1.15.2), 1.16 (20w13b, 20w14a, 1.16-rc1, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5), 1.17, 1.17.1, 1.18 (1.18, 1.18.1, 1.18.2), 1.19 (1.19, 1.19.2, 1.19.3, 1.19.4), 1.20 (1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6), 1.21 (1.21, 1.21.1, 1.21.3)
13
+ <!--NEXT PC-->
13
14
  * Minecraft bedrock version 0.14, 0.15, 1.0, 1.16.201, 1.16.210, 1.16.220, 1.17.0, 1.17.10, 1.17.30, 1.17.40, 1.18.0, 1.18.11, 1.18.30, 1.19.1, 1.19.10, 1.19.20, 1.19.21, 1.19.30, 1.19.40, 1.19.50, 1.19.60, 1.19.62, 1.19.63, 1.19.70, 1.19.80, 1.20.0, 1.20.10, 1.20.30, 1.20.40, 1.20.50, 1.20.61, 1.20.71, 1.20.80, 1.21.0, 1.21.2, 1.21.20, 1.21.30, 1.21.42, 1.21.50, 1.21.60, 1.21.70, 1.21.80, 1.21.90, 1.21.93, 1.21.100
15
+ <!--NEXT BEDROCK-->
14
16
 
15
17
  ## Wrappers
16
18