-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add data renames (blocks & items) #836
Conversation
how did you generate it ? |
For most versions I specified it manually (or almost manually by looking at data fixer code) since there are not many renames. But for the 1.13 version I used this script: //@ts-check
import fs from 'fs'
import minecraftData from 'minecraft-data'
const mcData = minecraftData('1.12.2')
const file = JSON.parse(fs.readFileSync('node_modules/minecraft-data/minecraft-data/data/pc/common/legacy.json', 'utf8'))
let map = []
for (const [key, item] of Object.entries(file.blocks)) {
const item2 = mcData.blocks[key.split(':')[0]];
if (!item2) continue
const oldName = item2.name
const newName = item.split(':')[1].split('[')[0];
if (map.find(x => x[1] === newName && x[0] === oldName)) {
continue
}
if (newName === oldName) {
continue
}
map.push([oldName, newName])
}
fs.writeFileSync('map.json', JSON.stringify(map, null, 2)) |
Im not sure if thats possible to generate with the server. I tried to extract using text manipulation (by looking at |
Waiting for this pr, then add a function to use it to node wrapper |
I'm looking at the file and actually I don't understand what this is. What is a new name ? What is an old name ? |
Also, the code above mentions the process of creating the map for 1.13: I will also open a pr in nmd so you can better understand how real code works with this format. |
PrismarineJS/node-minecraft-data#335 (comment) following of the conversation there. TLDR: most of these "renames" are not renames but actually just some block being removed in old version and some block being added in new version. A better solution may be to create "group of similar blocks" like grass, chest,... That you could handle in a similar way in downstream code |
The renames in this PR still contain many renames between blocks that do not have the same semantic |
Re open if you want to finish it |
fixes #833