-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use correct mapping file to map variants to properties for all pre-flattening versions #95
Comments
some pointers on fixing legacy.json it was added in PrismarineJS/minecraft-data#397 PrismarineJS/minecraft-data#216 has more contexts the correct way here is to fix this file imo |
my bet is in this case option 1 is the easiest |
I believe https://github.com/extremeheat/extracted_minecraft_data/blob/client1.13.2/client/net/minecraft/util/datafix/fixes/BlockStateFlatteningMap.java#L85 should have the mapping data. It's what vanilla does to convert the old IDs to block states. For the IDs, the lower 4 bits are metadata, and other upper bits are the block ID const blockId = index >> 4
const metadata = index & 0b1111 |
this specific example you were mentioning with lever seems correct there @zardoy |
This is the repo I was looking for all that time, spent a few hours reading different files, and this is really good. I see a lot of data can be also extracted like mob models etc, also will use it for reference. Thank you so much! So do we change the current legacy.json or add a new json mapping file to the current repo? Whoever does it please let's ensure it's as small as possible, the current legacy.json file is just unnecessary big |
Yeah let's do it. Do you want to give it a try ?
…On Mon, Dec 18, 2023, 18:52 Vitaly ***@***.***> wrote:
***@***.***
/client/net/minecraft/util/datafix/fixes/BlockStateFlatteningMap.java#L533
<https://github.com/extremeheat/extracted_minecraft_data/blob/client1.13.2/client/net/minecraft/util/datafix/fixes/BlockStateFlatteningMap.java?rgh-link-date=2023-12-18T00%3A56%3A22Z#L533>
This is the repo I was looking for all that time, spent a few hours
reading different files, and this is really good. I see a lot of data can
be also extracted like mob models etc, also will use it for reference.
Thank you so much!
btw the same on the latest version of mc is
client/net/minecraft/util/datafix/fixes/BlockStateData.java
------------------------------
So do we change the current legacy.json or add a new json mapping file to
the current repo? Whoever does it please let's ensure it's as small as
possible, the current legacy.json file is just unnecessary big
—
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437UYJUSUPGMYQGH34KLYKB7GZAVCNFSM6AAAAABAYR6Y66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRGE4DOMBTGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
not at the time, also I'm not sure what is id as the first argument and how to get the block variation number instead |
Block variation number is in order
As for the id we can fetch it from blocks.json
…On Mon, Dec 18, 2023, 21:16 Vitaly ***@***.***> wrote:
not at the time, also I'm not sure what is id as the first argument and
how to get the block variation number instead
—
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437X6GEVZIHTB5MQE3MDYKCQCRAVCNFSM6AAAAABAYR6Y66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRGUZTANBSGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The format was easy: id is the number divided by 16 and metadata (variant) is n mod 16 (basically its state id). However, after fixing this format, I realized that the block-state format for all pre-flat versions is not correct (no variants support like colored wools and some blocks are missing like concrete for 1.12). And instead of fixing these, it was much easier to just use 1.13 block states for all pre-flat versions (and it works perfectly without downsides). So now I have the map from type:metadata to new_block_name[new_props], if you want I can replace the current legacy.json with that format just made a parser script for that java file: https://gist.github.com/zardoy/b3b6ba9707ee2c94f2b7f0a1594ce3ce |
As said in PrismarineJS/minecraft-data#771 (comment) the legacy.json returns incorrect mapping by design, the correct mappings should be used instead.
For example lever with the state 69:0:
powered=false,facing=north,face=ceiling
facing=down_x,powered=false
, actual post flattening:powered=false,facing=west,face=ceiling
as you can see legacy.json has incorrect block properties for 69:0 even for a post-flattening format. There are a couple of things that I've considered to solve this issue:
The text was updated successfully, but these errors were encountered: