-
Notifications
You must be signed in to change notification settings - Fork 5
Support parsing block_states with version greater than 1.18 #17
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
base: main
Are you sure you want to change the base?
Conversation
|
Thank you, this is such a welcome contribution! Btw, is the difference only in the capitalization of names ( If not, I'd prefer the old function to remain intact, possibly provisionally renamed as In the future, if desired, |
|
Also, would you mind adding a "Fix #10" suffix to the commit message so that bug is properly closed and linked to this fix? |
|
Thanks, I would try your suggestion to make backward compatible and update suffix. About difference, it is not the only capitalization, base on my experiment on 1.21 and wiki description, the different is:
|
- Upgrade supportting parsing version to 1.21 - Fix '_decode_blockstates' if palette number greater than 16
|
When is this getting merged? I would love to see this implemented, as there are currently no working MC world manipulation python libraries. |
Because that the index of palette array begins from 0, so the maximux index is 1 less than palette length
I didn't have the time to properly review or test it yet. The new block state format changes more than just renaming/reorganizing keys in the NBT structure, and this PR also deals with backward-compatibility at run time, so not very trivial. If anyone can/wants to test this, or even step up as a co-maintainer of this project, I would appreciate! |
|
To anyone in the future: PR seems to work for 1.21.8. (atleast the few methods I tested), recommend just cloning and replacing your current mcworldlib folder with the one from suzaku's repo |
| def get_blocks(self): | ||
| """Yield a (Y, Palette, BlockState Indexes Array) tuple for every chunk section. | ||
|
|
||
| def is_version_1_21(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def is_version_1_21(self): | |
| def is_version_1_18(self): |
In fact (as described in the Wiki and I also tested by myself), the change of name "Sections" to "sections" and other name changes is applied from 1.18 rather than 1.21.
So the name can be changed?
|
I tested this PR on:
All of them work well. So I think it is OK to merge this PR. The function work good, though it has some code names that may confuse others as I commented above. |
Besides, I'm also interested in step up as a co-maintainer of this project, (as it is very useful and helped me find my Little Maid's tomb position when I'm offline, on 1.20.1.) @MestreLion |


Fix relate issue: #10, cite: https://minecraft.wiki/w/Chunk_format
But in contrast, this pr will cause that deprecating the support for old versions. So maybe creating a new branch is a better idea?