refactor(stash-finder): modernize file IO and CSV handling - #6607
Open
Big-Iron-Cheems wants to merge 4 commits into
Open
refactor(stash-finder): modernize file IO and CSV handling#6607Big-Iron-Cheems wants to merge 4 commits into
Big-Iron-Cheems wants to merge 4 commits into
Conversation
This also fixes mismatches in CSV field read/writes.
Mistakenly switched to world coords.
No need to store transient x/z coords and recalculate the values on load.
Only the counters are to be mutated at any time.
MukjepScarlet
approved these changes
Aug 27, 2026
| String line; | ||
| while ((line = reader.readLine()) != null) { | ||
| String[] values = line.split(" "); | ||
| String[] values = line.split(","); |
Contributor
There was a problem hiding this comment.
Can use apache's StringUtils.split(String, char)
| String header = CSV_FIELDS.stream() | ||
| .map(CsvField::name) | ||
| .collect(Collectors.joining(",")); | ||
| writer.write(header + "\n"); |
Contributor
There was a problem hiding this comment.
write(header).append('\n')
write(header)
newLine()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
Refactors
StashFinderfile I/O and chunk coordinate handling.The changes modernize the CSV serialization/deserialization by defining CSV fields with explicit getters and setters,
while keeping CSV coordinates stored as chunk coordinates, matching the existing JSON representation and preserving the previous coordinate format.
Chunk world coordinates are no longer stored as redundant/
transientfields.They are derived directly from
ChunkPosusing Minecraft'sChunkPoshelpers, ensuring there is a single source of truth for chunk position and avoiding duplicated coordinate state.ChunkPosis also treated as effectively immutable withinChunk, reflecting that the chunk position is assigned when the stash is created and is not subsequently replaced.Related issues
None.
How Has This Been Tested?
Tested by loading and saving existing StashFinder JSON/CSV data and verifying that:
ChunkPos.Checklist: