新增两模块: mcfold/anvil.py 存档读取(region/NBT)+ 区块编解码工具 mcfold/render_bridge.py 桥:常驻 Java 渲染器进程,NDJSON 协议 mcfold/render.py 对外入口:WorldRenderer(存档→画面) scaffold/McfoldRenderServer.java Java 侧服务端(常驻,NDJSON) 实测(真实存档 mc-test,DataVersion 3465=1.20.1): injected=81 unknownBlocks=0 uniqueSpecs=111 loadedChunks=81 chunksRendered=60 distinctColors=11585 画面:草地/沙滩/树/水/天空/太阳/HUD(sample-real-save-render.png) ★ 分工落在实处(附录 D 的结论变成代码): 存档 palette 是**方块名**(minecraft:oak_log[axis=y]),网络载荷要 **state id**, 名字→id 的权威映射只有客户端注册表有 ⇒ 新增 resolve 命令, Java 侧用 BlockStateParser.parseForBlock 解析(实测 111 种全中,0 unknown) 踩坑(本轮新发现): 1. level.dat 有两种布局(8字节头+zlib / 直接 gzip)—— 实测本机是后者 2. section 索引 ≠ 绝对 Y:存档用 -4..19,载荷用 0..23(少这步 → readerIndex 越界) 3. 注入前必须 set_viewport,否则 ClientChunkCache.inRange 丢弃区块 4. setPos 不会更新实体区块归属,要 setPosRaw + updateViewCenter 5. 生物群系只影响着色,用统一 plains 不影响「能渲染出世界」 6. camera 回包要用 JsonArray,字符串会被 Python tuple() 按字符拆开 性能:启动 66s(GL+资源重载),之后每帧渲染 ~1s(含 100 帧 tick)
73 lines
6.7 KiB
Plaintext
73 lines
6.7 KiB
Plaintext
[17:19:27] [Datafixer Bootstrap/INFO]: 188 Datafixer optimizations took 93 milliseconds
|
|
[17:19:28] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
|
|
[17:19:29] [main/ERROR]: Failed to verify authentication
|
|
com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401
|
|
at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56) ~[authlib-4.0.43.jar:?]
|
|
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156) ~[authlib-4.0.43.jar:?]
|
|
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.<init>(YggdrasilUserApiService.java:55) ~[authlib-4.0.43.jar:?]
|
|
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124) ~[authlib-4.0.43.jar:?]
|
|
at net.minecraft.client.Minecraft.createUserApiService(SourceFile:733) ~[client-named.jar:?]
|
|
at net.minecraft.client.Minecraft.<init>(SourceFile:442) ~[client-named.jar:?]
|
|
at McfoldRenderServer.boot(McfoldRenderServer.java:434) ~[classes/:?]
|
|
at McfoldRenderServer.main(McfoldRenderServer.java:104) ~[classes/:?]
|
|
Caused by: com.mojang.authlib.exceptions.MinecraftClientHttpException: Status: 401
|
|
at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85) ~[authlib-4.0.43.jar:?]
|
|
at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48) ~[authlib-4.0.43.jar:?]
|
|
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129) ~[authlib-4.0.43.jar:?]
|
|
... 6 more
|
|
[17:19:29] [main/INFO]: Setting user: mcfold_cam
|
|
[17:19:29] [main/INFO]: Backend library: LWJGL version 3.3.1 build 7
|
|
[17:19:29] [main/INFO]: [STDERR]: [LWJGL] [ThreadLocalUtil] Unsupported JNI version detected, this may result in a crash. Please inform LWJGL developers.
|
|
[17:19:29] [main/WARN]: Attempted to end step for load_time_pre_window_ms before starting it
|
|
[17:19:29] [main/INFO]: Reloading ResourceManager: vanilla
|
|
[17:19:30] [Worker-Main-11/INFO]: Found unifont_all_no_pua-15.0.06.hex, loading
|
|
[17:19:30] [main/INFO]: [STDERR]: [mcfold] Minecraft constructed
|
|
[17:20:30] [main/INFO]: [STDERR]: [mcfold] TIMEOUT TextureManager
|
|
[17:20:30] [main/WARN]: Missing sound for event: minecraft:item.goat_horn.play
|
|
[17:20:30] [main/WARN]: Missing sound for event: minecraft:entity.goat.screaming.horn_break
|
|
[17:20:30] [main/ERROR]: Error starting SoundSystem. Turning off sounds & music
|
|
java.lang.IllegalStateException: Failed to open OpenAL device
|
|
at com.mojang.blaze3d.audio.Library.openDeviceOrFallback(SourceFile:283) ~[client-named.jar:?]
|
|
at com.mojang.blaze3d.audio.Library.init(SourceFile:153) ~[client-named.jar:?]
|
|
at net.minecraft.client.sounds.SoundEngine.loadLibrary(SourceFile:116) ~[client-named.jar:?]
|
|
at net.minecraft.client.sounds.SoundEngine.reload(SourceFile:106) ~[client-named.jar:?]
|
|
at net.minecraft.client.sounds.SoundManager.apply(SourceFile:125) ~[client-named.jar:?]
|
|
at net.minecraft.client.sounds.SoundManager.apply(SourceFile:40) ~[client-named.jar:?]
|
|
at net.minecraft.server.packs.resources.SimplePreparableReloadListener.lambda$reload$1(SourceFile:13) ~[client-named.jar:?]
|
|
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
|
|
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
|
|
at java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:754) ~[?:?]
|
|
at java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:735) ~[?:?]
|
|
at java.util.concurrent.CompletableFuture.thenAcceptAsync(CompletableFuture.java:2223) ~[?:?]
|
|
at net.minecraft.server.packs.resources.SimplePreparableReloadListener.reload(SourceFile:13) ~[client-named.jar:?]
|
|
at McfoldRenderServer.reloadResources(McfoldRenderServer.java:505) ~[classes/:?]
|
|
at McfoldRenderServer.boot(McfoldRenderServer.java:438) ~[classes/:?]
|
|
at McfoldRenderServer.main(McfoldRenderServer.java:104) ~[classes/:?]
|
|
[17:20:30] [main/INFO]: Found unifont_all_no_pua-15.0.06.hex, loading
|
|
[17:20:30] [main/INFO]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 256x256x4 minecraft:textures/atlas/signs.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/armor_trims.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 128x64x4 minecraft:textures/atlas/decorated_pot.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
|
|
[17:20:30] [main/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
|
|
[17:20:31] [main/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program.
|
|
[17:20:31] [main/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
|
|
[17:20:31] [main/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
|
|
[17:20:31] [main/INFO]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
|
|
[17:20:31] [main/INFO]: [STDERR]: [mcfold] resources reloaded
|
|
[17:20:31] [main/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program.
|
|
[17:20:31] [main/INFO]: [STDERR]: [mcfold] boot done
|
|
[17:20:32] [main/INFO]: [STDERR]: java.lang.IndexOutOfBoundsException: readerIndex(8458) + length(2) exceeds writerIndex(8458): UnpooledHeapByteBuf(ridx: 8458, widx: 8458, cap: 8458/8458)
|
|
[17:20:32] [main/INFO]: [STDERR]: at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442)
|
|
[17:20:32] [main/INFO]: [STDERR]: at io.netty.buffer.AbstractByteBuf.readShort(AbstractByteBuf.java:749)
|
|
[17:20:32] [main/INFO]: [STDERR]: at net.minecraft.network.FriendlyByteBuf.readShort(SourceFile:1313)
|
|
[17:20:32] [main/INFO]: [STDERR]: at net.minecraft.world.level.chunk.LevelChunkSection.read(SourceFile:156)
|
|
[17:20:32] [main/INFO]: [STDERR]: at net.minecraft.world.level.chunk.LevelChunk.replaceWithPacketData(SourceFile:456)
|
|
[17:20:32] [main/INFO]: [STDERR]: at net.minecraft.client.multiplayer.ClientChunkCache.replaceWithPacketData(SourceFile:117)
|
|
[17:20:32] [main/INFO]: [STDERR]: at McfoldRenderServer.applyChunk(McfoldRenderServer.java:335)
|
|
[17:20:32] [main/INFO]: [STDERR]: at McfoldRenderServer.handle(McfoldRenderServer.java:160)
|
|
[17:20:32] [main/INFO]: [STDERR]: at McfoldRenderServer.main(McfoldRenderServer.java:126)
|