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 243 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 18 commits November 6, 2021 21:25
Exposed region xz getters setters on MCAFileBase
Fixed template param on SectionedChunkBase
Enhancing test base assertThrowsNoException method to always report useful stacktrace (without using printStacktrace)
….18 21w44a (DV 2845)

Adding a .md file to test resources to describe the properties of the test data for future reference.
Added informational getters to MCAFileBase to expose min and max data values as read from disk.
Exposed ability for lib users to control the default data version of chunks auto-created by various MCAFile calls.
Enhanced data version consistency throughout mca files, chunks, and sections. It should require much less care by this libraries users to maintain consistent data version values.
Also added "createChunk" "createSection" helpers on MCAFile and Chunk respectively which will create objects with consistent data versions.
Added explicit upgrade handling for Section blocks state when upgrading data versions from 1.14 and below to 1.15 and above.
Improved consistency of Section "Y" values and to reduce risk of accidents for library users. It is still possible for a Section to have a "height" (aka Y) different from where the Chunk thinks it belongs, the Chunk has the final say now for sure and the occurrence of this inconsistency should be reduced.
…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 7 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
…tion to working with all long[] packed values (block palettes, biome palettes, Heightmaps) across all DataVersions.
- renaming 'capacity' to 'length' and exposed the final length variable publicly like a java array.
- setting default builder PackingStrategy
- changed builder set dataVersion behavior to treat 0 as 'use latest'
- implementing Cloneable
- adding count(IntPredicate) helper
- renamed toValueArray functions to toArray
- renamed setFromValueArray functions to setFromArray
- added tests for all new functions & changes
… Renamed getTag() to getHandle() matching TagWrapper name.
- implement TagWrapper
- making use of LongArrayTagPackedIntegers instead of storing data in int[]
- 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
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.

None yet

4 participants