minecraft-data 3.44.0 → 3.45.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/doc/history.md +4 -0
- package/minecraft-data/.github/helper-bot/index.js +58 -59
- package/minecraft-data/.github/workflows/update-helper.yml +1 -1
- package/minecraft-data/data/bedrock/common/features.json +10 -0
- package/minecraft-data/data/pc/1.20/blocks.json +18251 -16821
- package/minecraft-data/data/pc/common/features.json +16 -1
- package/minecraft-data/data/pc/common/protocolVersions.json +16 -0
- package/minecraft-data/doc/history.md +5 -0
- package/package.json +1 -1
package/doc/history.md
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
const cp = require('child_process')
|
|
3
|
-
const https = require('https')
|
|
4
3
|
const helper = require('./github-helper')
|
|
5
4
|
const pcManifestURL = 'https://launchermeta.mojang.com/mc/game/version_manifest.json'
|
|
6
5
|
const changelogURL = 'https://feedback.minecraft.net/hc/en-us/sections/360001186971-Release-Changelogs'
|
|
7
6
|
|
|
8
|
-
// this is a polyfill for node <18
|
|
9
|
-
const fetch = globalThis.fetch || function (url) {
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
https.get(url, (res) => {
|
|
12
|
-
let data = ''
|
|
13
|
-
res.on('data', (chunk) => {
|
|
14
|
-
data += chunk
|
|
15
|
-
})
|
|
16
|
-
res.on('end', () => {
|
|
17
|
-
resolve({
|
|
18
|
-
ok: true,
|
|
19
|
-
text: () => Promise.resolve(data),
|
|
20
|
-
json: () => Promise.resolve(JSON.parse(data))
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
}).on('error', reject)
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
7
|
const download = (url, dest) => cp.execSync(`curl -L ${url} -o ${dest}`)
|
|
27
8
|
|
|
28
9
|
function buildFirstIssue (title, result, jarData) {
|
|
@@ -65,43 +46,78 @@ async function updateManifestPC () {
|
|
|
65
46
|
const manifest = await fetch(pcManifestURL).then(res => res.json())
|
|
66
47
|
// fs.writeFileSync('./manifest.json', JSON.stringify(manifest, null, 2))
|
|
67
48
|
const knownVersions = protocolVersions.pc.reduce((acc, cur) => (acc[cur.minecraftVersion] = cur, acc), {})
|
|
68
|
-
const
|
|
49
|
+
const latestVersion = manifest.latest.snapshot
|
|
50
|
+
const latestVersionData = manifest.versions.find(v => v.id === latestVersion)
|
|
51
|
+
const latestVersionIsSnapshot = latestVersionData.type !== 'release'
|
|
69
52
|
|
|
70
|
-
const title = `Support Minecraft PC ${
|
|
53
|
+
const title = `Support Minecraft PC ${latestVersion}`
|
|
71
54
|
const issueStatus = await helper.getIssueStatus(title)
|
|
72
55
|
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
if (latestVersionIsSnapshot) {
|
|
57
|
+
// don't make issues for snapshots
|
|
58
|
+
if (supportedVersions.pc.includes(latestVersion) || knownVersions[latestVersion]) {
|
|
59
|
+
console.log('Latest version is a known snapshot, no work to do')
|
|
60
|
+
return
|
|
76
61
|
}
|
|
77
|
-
console.log('Latest PC version is supported.')
|
|
78
|
-
return
|
|
79
|
-
} else if (knownVersions[latestRelease]) {
|
|
80
|
-
console.log(`Latest PC version ${latestRelease} is known in protocolVersions.json, but not in versions.json (protocol version ${knownVersions[latestRelease].version})`)
|
|
81
|
-
return
|
|
82
62
|
} else {
|
|
83
|
-
|
|
63
|
+
if (supportedVersions.pc.includes(latestVersion)) {
|
|
64
|
+
if (issueStatus.open) {
|
|
65
|
+
helper.close(issueStatus.id, `Closing as PC ${latestVersion} is now supported`)
|
|
66
|
+
}
|
|
67
|
+
console.log('Latest PC version is supported.')
|
|
68
|
+
return
|
|
69
|
+
} else if (knownVersions[latestVersion]) {
|
|
70
|
+
console.log(`Latest PC version ${latestVersion} is known in protocolVersions.json, but not in versions.json (protocol version ${knownVersions[latestVersion].version})`)
|
|
71
|
+
return
|
|
72
|
+
} else {
|
|
73
|
+
console.log(`Latest PC version ${latestVersion} is not known in protocolVersions.json, adding and making issue`)
|
|
74
|
+
}
|
|
84
75
|
}
|
|
85
|
-
const latestReleaseData = manifest.versions.find(v => v.id === latestRelease)
|
|
86
76
|
|
|
87
|
-
|
|
88
|
-
// (data like protocol/blocks/items/etc is present), just to make sure the known protocol version is correct.
|
|
77
|
+
let versionJson
|
|
89
78
|
try {
|
|
90
|
-
|
|
79
|
+
versionJson = await addEntryFor(latestVersion, latestVersionData)
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.error(e)
|
|
82
|
+
|
|
83
|
+
if (latestVersionIsSnapshot) {
|
|
84
|
+
console.warn('Failed to update protocolVersions.json for the snapshot', latestVersion)
|
|
85
|
+
} else {
|
|
86
|
+
console.log('Latest PC version is not supported and we failed to load data. Opening issue...')
|
|
87
|
+
const issuePayload = buildFirstIssue(title, latestVersionData)
|
|
88
|
+
helper.createIssue(issuePayload)
|
|
89
|
+
|
|
90
|
+
fs.writeFileSync('./issue.md', issuePayload.body)
|
|
91
|
+
console.log('OK, wrote to ./issue.md', issuePayload)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!latestVersionIsSnapshot && !issueStatus.open && !issueStatus.closed) {
|
|
96
|
+
console.log('Opening issue', versionJson)
|
|
97
|
+
const issuePayload = buildFirstIssue(title, latestVersionData, versionJson)
|
|
98
|
+
|
|
99
|
+
helper.createIssue(issuePayload)
|
|
100
|
+
|
|
101
|
+
fs.writeFileSync('./issue.md', issuePayload.body)
|
|
102
|
+
console.log('OK, wrote to ./issue.md', issuePayload)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function addEntryFor (releaseVersion, releaseData) {
|
|
106
|
+
const latestReleaseManifest = await fetch(releaseData.url).then(res => res.json())
|
|
91
107
|
// Download client jar
|
|
92
|
-
if (!fs.existsSync(`./${
|
|
108
|
+
if (!fs.existsSync(`./${releaseVersion}.jar`)) {
|
|
93
109
|
const clientJarUrl = latestReleaseManifest.downloads.client.url
|
|
94
110
|
console.log('Downloading client jar', clientJarUrl)
|
|
95
|
-
download(clientJarUrl, `./${
|
|
111
|
+
download(clientJarUrl, `./${releaseVersion}.jar`)
|
|
96
112
|
}
|
|
97
113
|
|
|
98
114
|
// Log the byte size of the client jar
|
|
99
|
-
const clientJarSize = fs.statSync(`./${
|
|
100
|
-
console.log(`Downloaded client jar ${
|
|
115
|
+
const clientJarSize = fs.statSync(`./${releaseVersion}.jar`).size
|
|
116
|
+
console.log(`Downloaded client jar ${releaseVersion}.jar (${clientJarSize} bytes), extracting its version.json...`)
|
|
101
117
|
|
|
102
118
|
// unzip with tar / unzip, Actions image uses 7z
|
|
103
|
-
if (process.platform === 'win32') cp.execSync(`tar -xf ./${
|
|
104
|
-
else cp.execSync(`7z -y e ./${
|
|
119
|
+
if (process.platform === 'win32') cp.execSync(`tar -xf ./${releaseVersion}.jar version.json`)
|
|
120
|
+
else cp.execSync(`7z -y e ./${releaseVersion}.jar version.json`, { stdio: 'inherit' })
|
|
105
121
|
const versionJson = require('./version.json')
|
|
106
122
|
|
|
107
123
|
let majorVersion
|
|
@@ -118,7 +134,7 @@ async function updateManifestPC () {
|
|
|
118
134
|
dataVersion: versionJson.world_version,
|
|
119
135
|
usesNetty: true,
|
|
120
136
|
majorVersion,
|
|
121
|
-
releaseType:
|
|
137
|
+
releaseType: latestVersionData.type
|
|
122
138
|
}
|
|
123
139
|
console.log('Adding new entry to pc protocolVersions.json', newEntry)
|
|
124
140
|
const updatedProtocolVersions = [newEntry, ...protocolVersions.pc]
|
|
@@ -134,24 +150,7 @@ async function updateManifestPC () {
|
|
|
134
150
|
cp.execSync('git push')
|
|
135
151
|
}
|
|
136
152
|
|
|
137
|
-
|
|
138
|
-
console.log('Opening issue', versionJson)
|
|
139
|
-
const issuePayload = buildFirstIssue(title, latestReleaseData, versionJson)
|
|
140
|
-
|
|
141
|
-
helper.createIssue(issuePayload)
|
|
142
|
-
|
|
143
|
-
fs.writeFileSync('./issue.md', issuePayload.body)
|
|
144
|
-
console.log('OK, wrote to ./issue.md', issuePayload)
|
|
145
|
-
}
|
|
146
|
-
} catch (e) {
|
|
147
|
-
console.error(e)
|
|
148
|
-
|
|
149
|
-
console.log('Latest PC version is not supported and we failed to load data. Opening issue...')
|
|
150
|
-
const issuePayload = buildFirstIssue(title, latestReleaseData)
|
|
151
|
-
helper.createIssue(issuePayload)
|
|
152
|
-
|
|
153
|
-
fs.writeFileSync('./issue.md', issuePayload.body)
|
|
154
|
-
console.log('OK, wrote to ./issue.md', issuePayload)
|
|
153
|
+
return versionJson
|
|
155
154
|
}
|
|
156
155
|
}
|
|
157
156
|
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "smallWorld",
|
|
4
|
+
"description": "world height is 128 blocks",
|
|
5
|
+
"version": "0.14.3"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "usesPalettedChunks",
|
|
9
|
+
"description": "the chunk format uses local palettes",
|
|
10
|
+
"versions": ["1.16_major", "latest"]
|
|
11
|
+
},
|
|
2
12
|
{
|
|
3
13
|
"name": "newRecipeSchema",
|
|
4
14
|
"description": "New recipe schema",
|