minecraft-data 3.98.0 → 3.99.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/data.js +27 -5
- package/doc/history.md +8 -0
- package/minecraft-data/.github/copilot-instructions.md +63 -0
- package/minecraft-data/.github/helper-bot/handleMcpcGeneratedArtifacts.js +18 -14
- package/minecraft-data/.github/helper-bot/index.js +3 -41
- package/minecraft-data/.github/helper-bot/utils.js +50 -0
- package/minecraft-data/.github/workflows/bedrock-ci.yml +3 -2
- package/minecraft-data/.github/workflows/handle-mcpc-generator.yml +11 -8
- package/minecraft-data/.github/workflows/update-helper.yml +1 -1
- package/minecraft-data/README.md +1 -1
- package/minecraft-data/data/bedrock/1.21.100/proto.yml +4573 -0
- package/minecraft-data/data/bedrock/1.21.100/types.yml +2841 -0
- package/minecraft-data/data/bedrock/1.21.111/proto.yml +4573 -0
- package/minecraft-data/data/bedrock/1.21.111/protocol.json +14380 -0
- package/minecraft-data/data/bedrock/1.21.111/types.yml +2841 -0
- package/minecraft-data/data/bedrock/1.21.111/version.json +6 -0
- package/minecraft-data/data/bedrock/common/protocolVersions.json +6 -0
- package/minecraft-data/data/bedrock/common/versions.json +2 -1
- package/minecraft-data/data/bedrock/latest/proto.yml +37 -30
- package/minecraft-data/data/bedrock/latest/types.yml +160 -154
- package/minecraft-data/data/dataPaths.json +27 -5
- package/minecraft-data/data/pc/common/protocolVersions.json +56 -0
- package/minecraft-data/doc/history.md +8 -0
- package/package.json +1 -1
package/data.js
CHANGED
|
@@ -2521,7 +2521,7 @@ module.exports =
|
|
|
2521
2521
|
get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
|
|
2522
2522
|
get protocol () { return require("./minecraft-data/data/bedrock/1.21.80/protocol.json") },
|
|
2523
2523
|
get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
|
|
2524
|
-
get steve () { return require("./minecraft-data/data/bedrock/1.21.
|
|
2524
|
+
get steve () { return require("./minecraft-data/data/bedrock/1.21.70/steve.json") },
|
|
2525
2525
|
get blocksB2J () { return require("./minecraft-data/data/bedrock/1.21.80/blocksB2J.json") },
|
|
2526
2526
|
get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.21.80/blocksJ2B.json") },
|
|
2527
2527
|
proto: __dirname + '/minecraft-data/data/bedrock/1.21.80/proto.yml',
|
|
@@ -2543,7 +2543,7 @@ module.exports =
|
|
|
2543
2543
|
get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
|
|
2544
2544
|
get protocol () { return require("./minecraft-data/data/bedrock/1.21.90/protocol.json") },
|
|
2545
2545
|
get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
|
|
2546
|
-
get steve () { return require("./minecraft-data/data/bedrock/1.21.
|
|
2546
|
+
get steve () { return require("./minecraft-data/data/bedrock/1.21.70/steve.json") },
|
|
2547
2547
|
get blocksB2J () { return require("./minecraft-data/data/bedrock/1.21.80/blocksB2J.json") },
|
|
2548
2548
|
get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.21.80/blocksJ2B.json") },
|
|
2549
2549
|
proto: __dirname + '/minecraft-data/data/bedrock/1.21.90/proto.yml',
|
|
@@ -2565,7 +2565,7 @@ module.exports =
|
|
|
2565
2565
|
get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
|
|
2566
2566
|
get protocol () { return require("./minecraft-data/data/bedrock/1.21.93/protocol.json") },
|
|
2567
2567
|
get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
|
|
2568
|
-
get steve () { return require("./minecraft-data/data/bedrock/1.21.
|
|
2568
|
+
get steve () { return require("./minecraft-data/data/bedrock/1.21.70/steve.json") },
|
|
2569
2569
|
get blocksB2J () { return require("./minecraft-data/data/bedrock/1.21.80/blocksB2J.json") },
|
|
2570
2570
|
get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.21.80/blocksJ2B.json") },
|
|
2571
2571
|
proto: __dirname + '/minecraft-data/data/bedrock/1.21.93/proto.yml',
|
|
@@ -2587,13 +2587,35 @@ module.exports =
|
|
|
2587
2587
|
get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
|
|
2588
2588
|
get protocol () { return require("./minecraft-data/data/bedrock/1.21.100/protocol.json") },
|
|
2589
2589
|
get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
|
|
2590
|
-
get steve () { return require("./minecraft-data/data/bedrock/1.21.
|
|
2590
|
+
get steve () { return require("./minecraft-data/data/bedrock/1.21.70/steve.json") },
|
|
2591
2591
|
get blocksB2J () { return require("./minecraft-data/data/bedrock/1.21.80/blocksB2J.json") },
|
|
2592
2592
|
get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.21.80/blocksJ2B.json") },
|
|
2593
|
-
proto: __dirname + '/minecraft-data/data/bedrock/
|
|
2593
|
+
proto: __dirname + '/minecraft-data/data/bedrock/1.21.100/proto.yml',
|
|
2594
2594
|
types: __dirname + '/minecraft-data/data/bedrock/latest/types.yml',
|
|
2595
2595
|
get version () { return require("./minecraft-data/data/bedrock/1.21.100/version.json") },
|
|
2596
2596
|
get language () { return require("./minecraft-data/data/bedrock/1.21.70/language.json") }
|
|
2597
|
+
},
|
|
2598
|
+
'1.21.111': {
|
|
2599
|
+
get blocks () { return require("./minecraft-data/data/bedrock/1.21.90/blocks.json") },
|
|
2600
|
+
get blockStates () { return require("./minecraft-data/data/bedrock/1.21.80/blockStates.json") },
|
|
2601
|
+
get blockCollisionShapes () { return require("./minecraft-data/data/bedrock/1.21.90/blockCollisionShapes.json") },
|
|
2602
|
+
get biomes () { return require("./minecraft-data/data/bedrock/1.21.60/biomes.json") },
|
|
2603
|
+
get entities () { return require("./minecraft-data/data/bedrock/1.21.80/entities.json") },
|
|
2604
|
+
get items () { return require("./minecraft-data/data/bedrock/1.21.90/items.json") },
|
|
2605
|
+
get recipes () { return require("./minecraft-data/data/bedrock/1.19.10/recipes.json") },
|
|
2606
|
+
get instruments () { return require("./minecraft-data/data/bedrock/1.17.0/instruments.json") },
|
|
2607
|
+
get materials () { return require("./minecraft-data/data/pc/1.17/materials.json") },
|
|
2608
|
+
get enchantments () { return require("./minecraft-data/data/bedrock/1.19.1/enchantments.json") },
|
|
2609
|
+
get effects () { return require("./minecraft-data/data/pc/1.17/effects.json") },
|
|
2610
|
+
get protocol () { return require("./minecraft-data/data/bedrock/1.21.111/protocol.json") },
|
|
2611
|
+
get windows () { return require("./minecraft-data/data/bedrock/1.16.201/windows.json") },
|
|
2612
|
+
get steve () { return require("./minecraft-data/data/bedrock/1.21.70/steve.json") },
|
|
2613
|
+
get blocksB2J () { return require("./minecraft-data/data/bedrock/1.21.80/blocksB2J.json") },
|
|
2614
|
+
get blocksJ2B () { return require("./minecraft-data/data/bedrock/1.21.80/blocksJ2B.json") },
|
|
2615
|
+
proto: __dirname + '/minecraft-data/data/bedrock/latest/proto.yml',
|
|
2616
|
+
types: __dirname + '/minecraft-data/data/bedrock/latest/types.yml',
|
|
2617
|
+
get version () { return require("./minecraft-data/data/bedrock/1.21.111/version.json") },
|
|
2618
|
+
get language () { return require("./minecraft-data/data/bedrock/1.21.70/language.json") }
|
|
2597
2619
|
}
|
|
2598
2620
|
}
|
|
2599
2621
|
}
|
package/doc/history.md
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
PrismarineJS/minecraft-data holds Minecraft data including game versions, protocol schemas, block/item/entity states, and more. It provides a comprehensive cross-language set of data files combined with schemas that can be consumed in any language.
|
|
2
|
+
|
|
3
|
+
## Directory Structure
|
|
4
|
+
- `.github/`
|
|
5
|
+
- `workflows/`
|
|
6
|
+
- `ci.yml` -- Runs CI here (cd tools/js && npm install && npm test)
|
|
7
|
+
- `bedrock-ci.yml` -- Runs CI for Bedrock Edition via workflow dispatch to PrismarineJS/bedrock-protocol. This allows for testing and validation of Bedrock-specific changes.
|
|
8
|
+
- `commands.yml` -- Slash commands
|
|
9
|
+
- `handleMcpcGeneratedArtifacts.js`
|
|
10
|
+
- `helper-bot/` -- Files for the GitHub Actions cron helper.
|
|
11
|
+
- `data/`
|
|
12
|
+
- `dataPaths.json` -- map of { ['pc' | 'bedrock']: { '$version': { 'dataType': 'folderPath' } } }
|
|
13
|
+
- `[pc | bedrock]/` -- Minecraft Java Edition data
|
|
14
|
+
- `1.20/` -- Versioned data for Minecraft Java Edition 1.20
|
|
15
|
+
- `$version/` -- Versioned data for Minecraft Java Edition $version
|
|
16
|
+
- `common/` -- Common data for all Minecraft Java Edition versions
|
|
17
|
+
- `protocolVersions.json` -- List of protocol versions for Minecraft Java Edition
|
|
18
|
+
- `latest/` -- This holds the latest protocol yaml files. They are used to generate the protocol.json files in each versioned folder (more on this below).
|
|
19
|
+
- `schemas/` -- JSON schemas for validating data files
|
|
20
|
+
- `tools/js` -- JavaScript utilities for working with repo (holds tests, some data generators and helper scripts)
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
No setup is needed as we just hold data. To set up the development environment that runs tests, run the following commands:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd tools/js
|
|
27
|
+
npm install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This will ensure all data matches schema among other checks.
|
|
31
|
+
|
|
32
|
+
There are no 'releases' in this repo beyond updating the data itself. Instead, we have a workflow that will automatically create tagged releases if the user runs the /makerelease slash command, so you can inform the user about that if a release is needed.
|
|
33
|
+
|
|
34
|
+
## Data
|
|
35
|
+
|
|
36
|
+
Most data is generated with data generators. For mcpc, data is generated with [minecraft-data-generator](https://github.com/PrismarineJS/minecraft-data-generator).
|
|
37
|
+
|
|
38
|
+
Avoid updating data manually unless necessary, like when specific data is not automated yet (for tips on what is and not, see doc/add-data-new-version.md). Instead, update the data generators or add new ones as needed. Since you don't have capability to make changes outside this repo, please inform the user what changes need to be made and be as detailed as possible.
|
|
39
|
+
|
|
40
|
+
Note we do not currently have any automation setup to generate bedrock edition data.
|
|
41
|
+
|
|
42
|
+
## Github Workflows
|
|
43
|
+
|
|
44
|
+
### Automation
|
|
45
|
+
|
|
46
|
+
Our GH Actions workflow (.github/helper-bot) auto updates the pc protocolVersions.json with new detected versions and also auto opens a scaffolding PR.
|
|
47
|
+
|
|
48
|
+
cron workflow .github/workflows/update-helper.yml -> .github/helper-bot/.
|
|
49
|
+
|
|
50
|
+
helper-bot dispatches to minecraft-data-generator so that it can run data generators for new versions. minecraft-data-generator then sends a workflow dispatch back to us so we can then take its generated artifacts and commit them here.
|
|
51
|
+
|
|
52
|
+
.github/workflows/handle-mcpc-generator.yml ->
|
|
53
|
+
.github/helper-bot/handleMcpcGeneratedArtifacts.js
|
|
54
|
+
|
|
55
|
+
## Notes
|
|
56
|
+
Not all data is generated. Some data (like protocol schemas) is manually curated on both pc and bedrock.
|
|
57
|
+
|
|
58
|
+
### Protocol data
|
|
59
|
+
|
|
60
|
+
We use a special yaml-like DSL to generate protocol.json files. Refer to doc/protocol.md for info.
|
|
61
|
+
These files are stored inside proto.yml files in the latest/ folder (like bedrock/latest/proto.yml) for the latest version, otherwise in the versioned folder (like pc/1.20/proto.yml).
|
|
62
|
+
|
|
63
|
+
Notably, run `npm run build` in tools/js to regenerate protocol.json files after making changes to the protocol yaml files. So, don't make changes to protocol.json files directly. Instead, update the relevant proto.yml file in latest/ and regenerate protocol.json by running `npm run build` in tools/js.
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
|
-
const cp = require('child_process')
|
|
3
2
|
const github = require('gh-helpers')()
|
|
4
3
|
const { join } = require('path')
|
|
5
4
|
const { extractPcEntityMetadata } = require('../../tools/js/extractPcEntityMetadata')
|
|
6
|
-
|
|
7
|
-
function exec (file, args = [], options = {}) {
|
|
8
|
-
const opts = { stdio: 'inherit', ...options }
|
|
9
|
-
console.log('> ', file, args.join(' '), options.cwd ? `(cwd: ${options.cwd})` : '')
|
|
10
|
-
return github.mock ? undefined : cp.execFileSync(file, args, opts)
|
|
11
|
-
}
|
|
5
|
+
const { exec, createInitialPR } = require('./utils')
|
|
12
6
|
|
|
13
7
|
const artifactsDir = join(__dirname, './artifacts')
|
|
14
8
|
const root = join(__dirname, '..', '..')
|
|
15
9
|
|
|
16
|
-
async function handle (ourPR, genPullNo, version, artifactURL) {
|
|
10
|
+
async function handle (ourPR, genPullNo, version, artifactURL, shouldPull) {
|
|
17
11
|
const branchNameVersion = version.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase()
|
|
18
12
|
const branch = ourPR.headBranch || `pc-${branchNameVersion}`
|
|
19
|
-
exec('git', ['pull', 'origin'])
|
|
13
|
+
if (shouldPull) exec('git', ['pull', 'origin'])
|
|
20
14
|
|
|
21
15
|
// if external PR:
|
|
22
16
|
// const branch = ourPR.headBranch
|
|
@@ -52,7 +46,7 @@ async function handle (ourPR, genPullNo, version, artifactURL) {
|
|
|
52
46
|
|
|
53
47
|
// https://github.com/PrismarineJS/minecraft-data-generator/actions/runs/17261281146/artifacts/3861320839
|
|
54
48
|
const s = artifactURL.split('github.com/')[1]
|
|
55
|
-
const [ownerName, repoName, _actions, _runs, _runId, _artifacts, artifactId] = s.split('/')
|
|
49
|
+
const [ownerName, repoName, _actions, _runs, _runId, _artifacts, artifactId] = s.split('/') // eslint-disable-line
|
|
56
50
|
console.log('Downloading artifacts', { ownerName, repoName, artifactId, artifactsDir })
|
|
57
51
|
await github.artifacts.downloadIdFrom(ownerName, repoName, artifactId, artifactsDir)
|
|
58
52
|
|
|
@@ -89,14 +83,23 @@ async function handle (ourPR, genPullNo, version, artifactURL) {
|
|
|
89
83
|
exec('git', ['push', 'origin', branch])
|
|
90
84
|
}
|
|
91
85
|
|
|
92
|
-
async function main (versions, genPullNo, artifactUrl) {
|
|
86
|
+
async function main (versions, genPullNo, artifactUrl, createPR) {
|
|
93
87
|
const version = versions.at(-1)
|
|
94
88
|
const pr = await github.findPullRequest({ titleIncludes: '🎈', author: null })
|
|
95
89
|
console.log('Found PR', pr)
|
|
96
90
|
if (pr && pr.isOpen) {
|
|
97
91
|
const details = await github.getPullRequest(pr.id)
|
|
98
92
|
console.log('PR', details)
|
|
99
|
-
await handle(details, genPullNo, version, artifactUrl)
|
|
93
|
+
await handle(details, genPullNo, version, artifactUrl, true)
|
|
94
|
+
} else if (createPR) {
|
|
95
|
+
const pr = await createInitialPR('pc', '(This issue was created for a minecraft-data-generator PR)', {
|
|
96
|
+
version,
|
|
97
|
+
protocolVersion: null
|
|
98
|
+
})
|
|
99
|
+
console.log('Created PR', pr)
|
|
100
|
+
const details = await github.getPullRequest(pr.number)
|
|
101
|
+
console.log('PR', details)
|
|
102
|
+
await handle(details, genPullNo, version, artifactUrl, false)
|
|
100
103
|
} else {
|
|
101
104
|
process.exit(1)
|
|
102
105
|
}
|
|
@@ -105,5 +108,6 @@ async function main (versions, genPullNo, artifactUrl) {
|
|
|
105
108
|
main(
|
|
106
109
|
JSON.parse(process.env.TRIGGER_MC_VERSIONS),
|
|
107
110
|
process.env.TRIGGER_PR_NO,
|
|
108
|
-
process.env.TRIGGER_ARTIFACT_URL
|
|
109
|
-
|
|
111
|
+
process.env.TRIGGER_ARTIFACT_URL,
|
|
112
|
+
process.env.CREATE_PR_IF_NONE
|
|
113
|
+
)
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-return-assign, no-sequences */
|
|
1
2
|
const fs = require('fs')
|
|
2
|
-
const cp = require('child_process')
|
|
3
3
|
const github = require('gh-helpers')()
|
|
4
4
|
const pcManifestURL = 'https://launchermeta.mojang.com/mc/game/version_manifest.json'
|
|
5
5
|
const changelogURL = 'https://feedback.minecraft.net/hc/en-us/sections/360001186971-Release-Changelogs'
|
|
6
|
+
const { exec, createInitialPR } = require('./utils')
|
|
6
7
|
|
|
7
|
-
function exec (file, args, options = {}) {
|
|
8
|
-
const opts = { stdio: 'inherit', ...options }
|
|
9
|
-
console.log('> ', file, args.join(' '), options.cwd ? `(cwd: ${options.cwd})` : '')
|
|
10
|
-
return github.mock ? undefined : cp.execFileSync(file, args, opts)
|
|
11
|
-
}
|
|
12
8
|
const download = (url, dest) => exec('curl', ['-L', url, '-o', dest])
|
|
13
9
|
|
|
14
10
|
function buildFirstIssue (title, result, jarData) {
|
|
@@ -39,40 +35,6 @@ A new Minecraft Java Edition version is available (as of ${date}), version **${r
|
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
async function createInitialPull (edition, issueUrl, { version, protocolVersion }) {
|
|
43
|
-
exec('npm', ['install'], { cwd: 'tools/js' })
|
|
44
|
-
exec('npm', ['run', 'version', edition, version, protocolVersion], { cwd: 'tools/js' })
|
|
45
|
-
exec('npm', ['run', 'build'], { cwd: 'tools/js' })
|
|
46
|
-
const branchNameVersion = version.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase()
|
|
47
|
-
const branchName = `${edition}-${branchNameVersion}`
|
|
48
|
-
const title = `🎈 Add Minecraft ${edition} ${version} data`
|
|
49
|
-
// First, delete any existing branch
|
|
50
|
-
try {
|
|
51
|
-
exec('git', ['branch', '-D', branchName])
|
|
52
|
-
} catch (e) {
|
|
53
|
-
// Branch doesn't exist, ignore error
|
|
54
|
-
}
|
|
55
|
-
exec('git', ['checkout', '-b', branchName])
|
|
56
|
-
exec('git', ['config', 'user.name', 'github-actions[bot]'])
|
|
57
|
-
exec('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com'])
|
|
58
|
-
exec('git', ['add', '--all'])
|
|
59
|
-
exec('git', ['commit', '-m', title])
|
|
60
|
-
exec('git', ['push', 'origin', branchName, '--force'])
|
|
61
|
-
const body = `
|
|
62
|
-
This automated PR sets up the relevant boilerplate for Minecraft ${edition} version ${version}. Fixes ${issueUrl}.
|
|
63
|
-
|
|
64
|
-
Related:
|
|
65
|
-
- Issue: ${issueUrl}
|
|
66
|
-
- Protocol Version: ${protocolVersion}
|
|
67
|
-
<!--minecraft-data-generator-placeholder-->
|
|
68
|
-
|
|
69
|
-
* You can help contribute to this PR by opening a PR against this <code branch>${branchName}</code> branch instead of <code>master</code>.
|
|
70
|
-
`
|
|
71
|
-
const pr = await github.createPullRequest(title, body, branchName, 'master')
|
|
72
|
-
pr.branchName = branchName
|
|
73
|
-
return pr
|
|
74
|
-
}
|
|
75
|
-
|
|
76
38
|
const protocolVersions = {
|
|
77
39
|
pc: require('../../data/pc/common/protocolVersions.json'),
|
|
78
40
|
bedrock: require('../../data/bedrock/common/protocolVersions.json')
|
|
@@ -144,7 +106,7 @@ async function updateManifestPC () {
|
|
|
144
106
|
console.log('Created issue', issue)
|
|
145
107
|
|
|
146
108
|
// Now create an initial PR with the new version data
|
|
147
|
-
const pr = await
|
|
109
|
+
const pr = await createInitialPR('pc', issue.url, {
|
|
148
110
|
minecraftVersion: versionJson.id,
|
|
149
111
|
version: latestVersion,
|
|
150
112
|
protocolVersion: versionJson.protocol_version
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const cp = require('child_process')
|
|
2
|
+
const github = require('gh-helpers')()
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
5
|
+
const pm = process.versions.bun ? process.execPath : 'npm'
|
|
6
|
+
|
|
7
|
+
function exec (file, args = [], options = {}) {
|
|
8
|
+
const opts = { stdio: ['inherit', 'inherit', 'inherit'], ...options }
|
|
9
|
+
console.log('> ', file, args.join(' '), options.cwd ? `(cwd: ${options.cwd})` : '')
|
|
10
|
+
return github.mock ? undefined : cp.execFileSync(file, args, opts)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const toolsJs = path.join(__dirname, '..', '..', 'tools', 'js')
|
|
14
|
+
const sanitizeBranch = (branchName) => branchName.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase()
|
|
15
|
+
|
|
16
|
+
async function createInitialPR (edition, issueUrl, { version, protocolVersion }) {
|
|
17
|
+
exec(pm, ['install'], { cwd: toolsJs })
|
|
18
|
+
if (protocolVersion) exec(pm, ['run', 'version', edition, version, protocolVersion], { cwd: toolsJs })
|
|
19
|
+
exec(pm, ['run', 'build'], { cwd: toolsJs })
|
|
20
|
+
const branchNameVersion = sanitizeBranch(version)
|
|
21
|
+
const branchName = `${edition}-${branchNameVersion}`
|
|
22
|
+
const title = `🎈 Add Minecraft ${edition} ${version} data`
|
|
23
|
+
// First, delete any existing branch
|
|
24
|
+
try {
|
|
25
|
+
exec('git', ['branch', '-D', branchName])
|
|
26
|
+
} catch (e) {
|
|
27
|
+
// Branch doesn't exist, ignore error
|
|
28
|
+
}
|
|
29
|
+
exec('git', ['checkout', '-b', branchName])
|
|
30
|
+
exec('git', ['config', 'user.name', 'github-actions[bot]'])
|
|
31
|
+
exec('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com'])
|
|
32
|
+
exec('git', ['add', '--all'])
|
|
33
|
+
exec('git', ['commit', '--allow-empty', '-m', title])
|
|
34
|
+
exec('git', ['push', 'origin', branchName, '--force'])
|
|
35
|
+
const body = `
|
|
36
|
+
This automated PR sets up the relevant boilerplate for Minecraft ${edition} version ${version}. Fixes ${issueUrl}.
|
|
37
|
+
|
|
38
|
+
Related:
|
|
39
|
+
- Issue: ${issueUrl}
|
|
40
|
+
- Protocol Version: ${protocolVersion}
|
|
41
|
+
<!--minecraft-data-generator-placeholder-->
|
|
42
|
+
|
|
43
|
+
* You can help contribute to this PR by opening a PR against this <code branch>${branchName}</code> branch instead of <code>master</code>.
|
|
44
|
+
`
|
|
45
|
+
const pr = await github.createPullRequest(title, body, branchName, 'master')
|
|
46
|
+
pr.branchName = branchName
|
|
47
|
+
return pr
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = { createInitialPR, exec }
|
|
@@ -45,7 +45,6 @@ jobs:
|
|
|
45
45
|
with:
|
|
46
46
|
repository: PrismarineJS/bedrock-protocol
|
|
47
47
|
path: bedrock-protocol
|
|
48
|
-
- run: ls -R .
|
|
49
48
|
# I forget the correct install order, do both
|
|
50
49
|
- name: Install bedrock-protocol
|
|
51
50
|
run: |
|
|
@@ -54,5 +53,7 @@ jobs:
|
|
|
54
53
|
npm i
|
|
55
54
|
npm install ../node-mcdata
|
|
56
55
|
- name: Running bedrock-protocol tests
|
|
57
|
-
run:
|
|
56
|
+
run: |
|
|
57
|
+
curl -o node_modules/protodef/src/serializer.js https://raw.githubusercontent.com/extremeheat/node-protodef/refs/heads/dlog/src/serializer.js && curl -o node_modules/protodef/src/compiler.js https://raw.githubusercontent.com/extremeheat/node-protodef/refs/heads/dlog/src/compiler.js
|
|
58
|
+
npm test
|
|
58
59
|
working-directory: bedrock-protocol
|
|
@@ -12,6 +12,10 @@ on:
|
|
|
12
12
|
prNumber:
|
|
13
13
|
description: 'Relevant minecraft-data-generator PR #'
|
|
14
14
|
required: false
|
|
15
|
+
createPr:
|
|
16
|
+
description: 'Whether to create a new PR if none exists'
|
|
17
|
+
required: false
|
|
18
|
+
default: 'false'
|
|
15
19
|
|
|
16
20
|
jobs:
|
|
17
21
|
update-mcdata:
|
|
@@ -20,17 +24,16 @@ jobs:
|
|
|
20
24
|
- uses: actions/checkout@v4
|
|
21
25
|
with:
|
|
22
26
|
submodules: true
|
|
23
|
-
-
|
|
24
|
-
uses: actions/setup-node@v1
|
|
27
|
+
- uses: oven-sh/setup-bun@v2
|
|
25
28
|
with:
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
- run:
|
|
30
|
-
|
|
31
|
-
- run: cd .github/helper-bot && node handleMcpcGeneratedArtifacts.js
|
|
29
|
+
bun-version: latest
|
|
30
|
+
- run: cd .github/helper-bot && bun install
|
|
31
|
+
- run: cd tools/js && bun install
|
|
32
|
+
- run: bun handleMcpcGeneratedArtifacts.js
|
|
33
|
+
working-directory: .github/helper-bot
|
|
32
34
|
env:
|
|
33
35
|
TRIGGER_MC_VERSIONS: ${{ github.event.inputs.versions }}
|
|
34
36
|
TRIGGER_PR_NO: ${{ github.event.inputs.prNumber }}
|
|
35
37
|
TRIGGER_ARTIFACT_URL: ${{ github.event.inputs.mergedArtifactURL }}
|
|
36
38
|
GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }}
|
|
39
|
+
CREATE_PR_IF_NONE: ${{ github.event.inputs.createPr }}
|
package/minecraft-data/README.md
CHANGED
|
@@ -11,7 +11,7 @@ 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), 1.21.8
|
|
13
13
|
<!--NEXT PC-->
|
|
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
|
|
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, 1.21.111
|
|
15
15
|
<!--NEXT BEDROCK-->
|
|
16
16
|
|
|
17
17
|
## Wrappers
|