fix: restore by MCA or chunk without leaking outside the selection - #67
Open
softmanmaker wants to merge 2 commits into
Open
fix: restore by MCA or chunk without leaking outside the selection#67softmanmaker wants to merge 2 commits into
softmanmaker wants to merge 2 commits into
Conversation
… the selection Keep --mca as whole-file restore, make --chunk merge only selected chunks, and treat coordinates as region/chunk indices unless --block is set. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid treating truncated backups as missing chunks, write through a temp file then atomic replace, and log one line per chunk or MCA instead of region/entities/poi paths. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Breaking change
区域回档命令语义变了,旧脚本/指令会按新含义执行,不再兼容。
旧写法
/xb restore <id> --chunk <x1> <z1> <x2> <z2>把数字当成方块坐标,但会整文件覆盖对应的.mca(512×512 方块)。新写法:
--mca与--chunk互斥--block才会按方块换算(--mca用shr 9,--chunk用shr 4)/xb restore 1 --chunk 0 0 10 10现在表示区块(0,0)–(10,10),不是方块(0,0)–(10,10)Summary
--mca仍按当前维度整文件恢复.mca;.mcc按所属区域过滤--chunk不再整文件覆盖.mca,只合并选中区块,同文件内其他区块保留DIM-1/DIM1/dimensions.mca内的多个区块一次读写;日志按区块/MCA 各一条,不再按region/entities/poi拆开.xb-new并校验,再原子move替换原文件Test plan
/xb restore N --mca 0 0 0 0只动当前维度的r.0.0.mca/xb restore N --chunk 0 0 10 10只恢复这些区块,同 MCA 其余区块不变/xb restore N --chunk --block 0 0 10 10换算为区块(0,0)--chunk 0 0 10 10不再按方块坐标理解RegionFileMergerTest/RegionalRestoreTest通过Made with Cursor