Repository navigation
让 PyMC 更像原版 1.21.1 服务端:原版地形、Anvil 存档、安全出生 - #3
Merged
Merged
Conversation
- 修正 1.21.1 serverbound 数据包 ID 表, 文本组件改用 NBT - 配置阶段同步完整原版注册表/标签, 主世界 min_y 修正为 -64 - 原版格式日志、启动/关闭流程、level.dat、ops/whitelist/ban JSON - RCON、online-mode 加密、命令树 (declare_commands) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
协议 - 修正 1.21.1 serverbound 数据包 ID 表 (聊天、移动、挖掘、放置等此前全部错位) - 文本组件按协议使用 NBT/JSON; 断开连接发送带原因的 Disconnect 包 - 配置阶段同步全部原版注册表、标签与 Feature Flags; 主世界 min_y=-64 - 完整 1.21.1 物品 ID 表; 修正物品栏窗口槽位、容器类型与 Set Slot 编码 - 命令树 (declare_commands)、Tab 补全、Acknowledge Block Change 服务端外壳 - 原版格式日志与 logs/latest.log 归档; 原版启动/关闭流程与提示 - server.properties 原版键名与格式; ops/whitelist/banned-*/usercache JSON - level.dat + session.lock 持久化出生点、时间、天气、游戏规则和种子 - RCON; online-mode 加密与 Mojang 会话验证 - 原版核心命令与翻译键反馈, OP 通知, 原版未知命令错误 玩法 - 原版登录检查、加入/离开/死亡消息、死亡掉落与重生 - 受伤动画、击退、PvP、潜行/疾跑/装备同步; 天空光与方块光 - 区块解码缓存与线程池组包, 消除每刻数百毫秒的卡顿 测试: 新增协议数据、配置、权限文件、level.dat、命令树、光照、RCON、 加密及端到端 TCP 登录测试 (162 通过) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Terrain: rewrite native/terrain_gen as a port of the vanilla 1.21.1 overworld generator driven by the vanilla worldgen JSON (noise router and density functions, Xoroshiro/legacy random, Perlin/Normal/Blended noise, aquifers, ore veins, multi-noise biome lookup, surface rules, Climate.findSpawnPosition), plus biome-aware feature decoration (trees, plants, ores, disks) that spans chunk borders. The server auto-builds the generator when no current binary is found. Saving: store regions as vanilla Anvil .mca (Linear worlds are converted on startup), write vanilla playerdata/<uuid>.dat NBT, and fix the block state property order (legacy chunks are detected and migrated). Spawning: vanilla world spawn search and spawnRadius fudging so new and respawning players land on safe ground, never in water, lava, tree tops or inside blocks. Respawn resolves off the event loop and sends position/health before streaming chunks. Also: cache encoded chunks and packets so joins/respawns don't re-encode unchanged chunks, and let block placement replace clicked replaceable blocks (grass, ferns, single snow layers) like vanilla. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
windows.h defined min/max macros that broke every std::min/std::max in the worldgen headers; define NOMINMAX (and WIN32_LEAN_AND_MEAN) before it and pass /DNOMINMAX from CMake, build.bat and the auto-builder. Drop /fp:contract-, which MSVC does not know: /fp:precise already keeps a*b+c unfused, so terrain stays bit-identical to Java. Pushing a v* tag now builds and tests all three platforms and publishes a release (PyMC-linux / PyMC-macos / PyMC-windows.exe plus the native helpers) with notes taken from the new CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
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.
概要
让 PyMC 的行为更接近原版 Minecraft Java 1.21.1 服务端。本 PR 包含分支上的全部提交。
原版服务端外壳与玩法(前几个提交)
logs/latest.log归档、启动/关闭流程和Done (N s)!提示server.properties、ops.json、whitelist.json、banned-*.json、usercache.json、level.dat、session.lockonline-mode正版验证(加密 + 会话服务器)原版地形(
native/terrain_gen重写)PositionalRandomFactoryClimate.findSpawnPositionworld/data/worldgen_overworld.json,由tools/gen_worldgen_data.py生成)-ffp-contract=off,保证浮点运算与 Java 逐位一致存档 / 读档
.mca;旧.linear区域启动时自动转换,原文件保留为.linear.bakplayerdata/<uuid>.dat(gzip NBT,原版槽位编号,末影箱,个人出生点),旧.json自动迁移安全出生 / 重生
spawnRadius范围内随机挑选安全地面(原版fudgeSpawnLocation),不会落在水里、岩浆、树顶或方块里性能与细节
测试
pytest:173 个测试全部通过。新增tests/test_world_persistence.py,覆盖 Anvil 读写、Linear→Anvil 迁移、playerdata NBT、方块状态顺序和缓存失效;原生地形测试也做了扩展kill -9后,数据都能保留已知限制
生物群系查找表来自 cubiomes(MIT),worldgen JSON 来自 misode/mcmeta。
Generated by Claude Code