-
-
Notifications
You must be signed in to change notification settings - Fork 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
Trouble parsing .mca region files #1
Comments
.mca files are not nbt files. The Region File Format uses several distinct regions of binary data to store minecraft chunks and some of these regions contain compressed nbt data. You can't use |
First of all, huge thanks for this library, @vberlier ! I was a long time user of That said...
What's the status on this |
Thanks for the feedback! It means a lot to me :) I've been thinking about writing a pythonic alternative to pymclevel ever since I started working on nbtlib. I have a bunch of ideas when it comes to API design but I've had to work on other things and haven't had enough time left to get started with the project and truly commit to it. I guess if there's enough interest I could try to finally begin working on it. |
Take a look on this WIP, already fully functional to read and save region files: https://github.com/MestreLion/mcworldlib/blob/master/mcworldlib/region.py I tried my best to follow nbtlib's API: It also follow some great nbtlib concepts:
And so on... It was intentionally designed to integrate nicely with nbtlib, so if you want I can prepare a version for PR. Being a part of nbtlib I would adjust the import from absolute to relative, possibly rename My goal with MCWorldLib is to resurrect my former PyMCToolsLib, now using Python 3 and nbtlib as its backend instead of the venerable but defunct |
I heard that this method have been fixed by mojang.
https://youtu.be/uw7vEGhKoH8
Is that true?
I don't think it is possible to be fixed without changing .mca format.
🤔
|
I didn't watch the whole video, but it seems to be discussing the 1MB limit for chunk, correct? Well, the only thing that really imposes this limit is the 1-byte unsigned chunk But... this I've just created an |
Your project looks really good! I'm trying to keep Don't hesitate opening other issues if you think there are things that could be tweaked in |
MestreLion/mcworldlib@22e5897#r36412924
Even if you can slove those problem, It's not worth it.😥 |
Thanks! It's been my pet project in the last few weeks. I'll surely publish it on PyPI once I have established a functional API. That said, I still think nbtlib itself should have an All you need is my
Thanks for such a welcoming response! Right now I've only found 3-4 issues that would definitely make my life easier. In order of importance:
I'll add issues and PRs on each of them, elaborating more about rationale and proposals. I'll also add more the more I use nbtlib it as the backend of my MCWorldLib project. So far it's been a huge pleasure to use this! |
I have notice that before. I m using |
but I did not say it because I think that consistency > convenience . |
as we have come to serialize_tag, I do some testing and found something wrong. nbtlib/nbtlib/literal/serializer.py Lines 128 to 131 in 0b454b7
#probably due to python 3.8 ? yes,it is.
even python 3.8 : bpo-36793: Removed str implementations from builtin types bool, int, float, complex and few classes from the standard library. They now inherit str() from object. |
You can use |
I believe the opposite, convenience should trump consistency. But, regardless of our opinions, it seems that was convenience, not consistency, that drove the decision to use tags' |
Let me create the issues so we can discuss each one separately without flooding this one, so this can focus solely on whether or not nbtlib should have a built-in |
Alright I'm going to look into all of this, thank you for contributing! And now that I think about it a built-in |
Examples: $ nbt -r tests/nbt_files/bigtest.nbt --path 'Level."listTest (compound)"[{name: "Compound tag #0"}]' {name: "Compound tag #0", created-on: 1264099775885L} $ nbt -r tests/nbt_files/bigtest.nbt --path 'Level."listTest (compound)"[0]' --json {"name": "Compound tag #0", "created-on": 1264099775885} $ nbt -r tests/nbt_files/bigtest.nbt --path 'Level."listTest (compound)"[].name' --json "Compound tag #0" "Compound tag #1" $ nbt -r tests/nbt_files/bigtest.nbt --path 'Level."listTest (compound)"[].name' --unpack Compound tag #0 Compound tag #1
I am trying to read the NBT data from region files but the output seems for every file seems to be an empty dictionary.
Here's an example of what I'm getting using the CLI, though this also happens while trying to read .mca files in python code as well.
$ nbt -r r.-1.-1.mca --plain
{}
The text was updated successfully, but these errors were encountered: