Skip to content
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

Improve correctness of 1.8 item varieties data #772

Merged
merged 11 commits into from
Dec 17, 2023
Merged

Improve correctness of 1.8 item varieties data #772

merged 11 commits into from
Dec 17, 2023

Conversation

kaduvert
Copy link
Contributor

No description provided.

@kaduvert kaduvert changed the title Add item variations for items which are also blocks Improve completeness of 1.8 item varieties data Sep 16, 2023
@kaduvert
Copy link
Contributor Author

i abandoned the idea of doing this for all versions, it's just too complicated and i've got no clue about them.
if anyone needs exactly what i need for 1.8, i leave some scripts here which i made for data manipulation / extraction:

// add block variations to item variations if they aren't present
// put in /data/pc
const fs = require('fs')

const versions = [
    '1.7',
    '1.8',
    '1.9',
    '1.10',
    '1.11',
    '1.12'
]

const itemFiles = versions.map((v) => require(`./${v}/items.json`))
const blockFiles = versions.map((v) => require(`./${v}/blocks.json`))

itemFiles.forEach((itemFile, i) => {
    itemFile.forEach(item => {
        const block = blockFiles[i].find(block => item.id === block.id)
        if (!item.variations && block && block.variations) {
            item.variations = block.variations
        }
    })
})

itemFiles.forEach((itemFile, i) => {
    fs.writeFileSync(`./${versions[i]}/items.json`, JSON.stringify(itemFile))
})
// spawn egg name extraction
// put in /data/pc/${version}
const entityFile = require(`./entities.json`)

const metadatas = []

entityFile.sort((a, b) => a.internalId - b.internalId).forEach((entity) => {
    metadatas.push({
        metadata: entity.internalId,
        displayName: 'Spawn ' + entity.displayName
    })
})

console.log(metadatas)

@kaduvert kaduvert marked this pull request as ready for review September 16, 2023 20:11
@kaduvert kaduvert changed the title Improve completeness of 1.8 item varieties data Improve correctness of 1.8 item varieties data Sep 17, 2023
@kaduvert
Copy link
Contributor Author

kaduvert commented Sep 17, 2023

i removed the flower pot item varieties because they don't exist; the data was faulty

@@ -2307,65 +3323,7 @@
"id": 390,
"displayName": "Flower Pot",
"name": "flower_pot",
"stackSize": 64,
"variations": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed ?

@rom1504
Copy link
Member

rom1504 commented Dec 17, 2023

looks reasonable except for the flower pot

@kaduvert
Copy link
Contributor Author

i answered that in the comment above...: #772 (comment)

as you're probably not willing to verify yourself, look: https://www.youtube.com/watch?v=tWyohVt3zZo

@rom1504
Copy link
Member

rom1504 commented Dec 17, 2023

ok

@rom1504 rom1504 merged commit cf23a7f into PrismarineJS:master Dec 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants