Blockception / BC-Minecraft-Bedrock-Diagnoser

A typescript package library that provides diagnostics for Minecraft bedrock projects
https://www.npmjs.com/package/bc-minecraft-bedrock-diagnoser
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Check if material instance points to valid texture in terrain textures #208

Closed Xterionix closed 6 hours ago

Xterionix commented 5 days ago

Looked into this; keys from diagnoser.getCache().textures do include textures found from atlas files. Although, I'm not sure there's a way to differentiate between whether it was an atlas texture, and if it came from terrain_texture.json rather than item_texture.json. Any ideas on what I should do?

DaanV2 commented 5 days ago

Would it help if you used this data?

https://github.com/Blockception/BC-Minecraft-Bedrock-Vanilla-Data/blob/main/src/Lib/Vanilla/ResourcePack/sounds_files.ts

Xterionix commented 3 days ago

That's just hardcoded vanilla sound paths, the material instance can point to a custom texture.

"minecraft:material_instances": {
                "*": {
                    "ambient_occlusion": true,
                    "face_dimming": true,
                    "render_method": "alpha_test",
                    "texture": "some_name"
                }
            }

I want to check if some_name is defined in the terrain_texture.json.

DaanV2 commented 3 days ago

All found texture atlasses end up atleast in diagnoser.getCache().resourcespack.textures.

Do no vanilla atlast is defined yet 🤔 , probably need to add those to the vanilla collection, and then create a function in the diagnosed to see if its an existing ID or not

Xterionix commented 3 days ago

Does diagnoser.getCache().resourcespack.textures store which atlas the texture came from and the key in the atlas.json?

DaanV2 commented 3 days ago

It should

Xterionix commented 3 days ago

Alr. I'll look into this when I get the chance and resolve this and #165