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

Scan new "entities" folders (>=1.17), fix scan of "poi" folders #167

Merged
merged 1 commit into from Nov 6, 2021
Merged

Scan new "entities" folders (>=1.17), fix scan of "poi" folders #167

merged 1 commit into from Nov 6, 2021

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2021

Hello ! ^^
This PR is the following of #166 (Even if it works without) and ends issue #165 (Please read it first).
It also fixes the scan of the poi folder for dimension.

Main changes :

  • poi isn't considered as a dimension anymore. I created a new system (Like dimensions) called "region files type", with currently 3 types : Regions (Level), POIs and Entities. Each dimension (Including the overworld) can have those 3 types or MCA files (Respectively stored in region, poi and entities).
  • This types system contains entities files, which is new.
  • RegionSet objects are differentiated by dimension AND type. This is especially used for wrong located or corrupted chunks replacement from a backup.
  • scan_chunk() can now recognize and analyze MCA files from entities. The differentiating factor is the presence of the Entities tag at the root of the chunk. For a region/level file, it is in the Level tag.
  • get_number_regions() now differentiate regions by type. It now returns a dictionary.
  • delete_entities() can be also used for entities MCA files.

I didn't test, but this commit should also fix issue #162.

Really important note, as last time : I am still not familiar with the Region-Fixer code and architecture, so this commit can possibly lead to problems and bugs. Thanks @Fenixin to be careful before merging this PR. ^^

Have a nice day ! ^^

@ghost ghost changed the title Scan new "entities" folders (>1.17), fix scan of "poi" folders Scan new "entities" folders (>=1.17), fix scan of "poi" folders Nov 2, 2021
In fact, "poi" and "entities" can be in any dimension
@Fenixin
Copy link
Owner

Fenixin commented Nov 3, 2021

Hey! Thanks a lot for your contribution!

I'll test and check both pull requests in the next few days and merge if nothing explodes.

Thanks again!

@ghost
Copy link
Author

ghost commented Nov 4, 2021

You're welcome. ^^
I tested it, but I don't think it's enough.
I think you should also read my code carefully, because you're the original developer, so you know better than me how everything works. So take your time ! :D
You can tell me if there are things I can improve, or if you wish, you can directly push on my repo to make some edits. ;)
Have a nice day !

@Fenixin
Copy link
Owner

Fenixin commented Nov 6, 2021

The changes seem to work perfectly well, there is only a small problem in summary() while generating the log for the overworld, I'll push a fix just now.

Thanks a lot for the changes! Nicely done and works like a charm!

Edit: not in summary, but in RegionSet.get_name()

@Fenixin Fenixin merged commit 5ca21bc into Fenixin:master Nov 6, 2021
@ghost
Copy link
Author

ghost commented Nov 6, 2021

It's great, thank you very much ! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant