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

Refactor in preparation for supporting POI and ENTITIES MCA files #68

Open
wants to merge 260 commits into
base: master
Choose a base branch
from

Conversation

ens-gijs
Copy link

@ens-gijs ens-gijs commented Nov 8, 2021

Love your library! I hope you can incorporate this large refactor which expands the mca API to improve ease of use and is a prerequisite for adding support for the new(ish) POI and ENTITES mca files. Also as I've started looking into the chunk data changes for 1.18... they look to be heading toward somewhat extensive and I'm willing to take on making the changes needed to support 1.18, but I'll be building in that support on top of my fork.

Let me know if you want to chat more, etc. Please perform your own integration testing as well as my changes add some fail-fast check to keep consumers from shooting themselves in the foot.

BuildTools added 8 commits November 7, 2021 20:42
…nient than using System.out for 100k of text
…rogression

Realized 1.18 is making a lot of chunk data changes, backed out partial 1.18 support so far - going to rethink how best approach 1.18 region mca data
Strengthened section-y synchronization and enforcement
Added a 1.17.1 region mca file - interestingly section y's range from -1 to 15...
@coveralls
Copy link

coveralls commented Nov 9, 2021

Coverage Status

Coverage increased (+0.8%) to 78.493% when pulling 52fbb72 on ens-gijs:master into 04bad90 on Querz:master.

BuildTools added 3 commits November 12, 2021 06:39
…mpoundTag data object.

ChunkBase fixed bug in ctor - should call initReferences0
@Meeples10
Copy link

Any updates on this? MCAUtil.read currently throws an IllegalArgumentException when reading an MCA file without a Level tag, which neither the entities nor POI files have.

BuildTools added 17 commits April 30, 2024 21:47
… name assertLoadFLag. Completed test testChunkSectionMinMaxSectionY which was accidentally left incomplete in previous commit.

ChunkIterator added currentWorldX/Z getters.

Moved deserializeChunk impl from MCAFile into MCAFileBase
…to be abel to customize the behavior of the "auto" factory methods in MCAUtil
…ior is now to use the current timestamp

Adding MCAFileBase#removeChunk
Mostly finalized POI support implementation
Starting POI support unit tests and started setting up abstract test pattern for ChunkBase
Chunks - Adding initMembers pattern to avoid NPE's from within overrides of initReferences
- adding lazy cubeEdgeLength() & squareEdgeLength()
- adding helper get/set 2d/3d
- adding toString overload
- adding toString
- bugfix: ctor taking tag as arg was setting initializeForStoring to palette.size().. should be palette.size() - 1
- added test to cover this missed case
- making set block and biome return bool indicating if the Y location exists
- bugfix, get/set biome forgot to divide coords by 4
…initialize mca file header tables in readonly mode
…nding rect types to create bounds from a list of points.
…hen 3d biomes were no longer stored at the chunk level.
McaWorld is the start of an effort to abstract away the interactions with individual chunks and mca files.

Initial impl supports:
- get heightmap value at XZ
- get chunk
- get region
- get/set biome
- get/set block
@HoldYourWaffle
Copy link
Contributor

I just noticed this PR seems to have grown into a proper fork, great work! I might consider moving over, but I have a couple questions:

  1. These base of these changes predates the nbt7 branch, which was the target for a bunch of refactors I have done since 2022. Do you think these improvements could be merged into your fork, or has it diverged too far by now?
    Based on a cursory look through the commit messages some of your changes sound very familiar, but there's so many that I can't get a full picture 😅
  2. Would you be open to Java 8 compatibility? (Restore Java 8 compatibility on the nbt7 branch #97)
    I need to use this library in a project with special requirements, I'd love to avoid adding another fork into the mix if possible.
  3. Your README mentions "ready for early adopters" - do you have a rough idea how long you'll still be making breaking changes?
    If question 2 is a 'no' (which I'd expect) it might make more sense to maintain a fork of something more stable.

I'd love to work together on this!

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.

4 participants