Repository navigation
Conversation
Nuitka's --include-data-dir silently skips .exe/.dll/.so/.dylib files, so the packaged servers never contained terrain_gen/mob_ai and fell back to the Python generator (~8 s per chunk). List the native files explicitly with --include-data-files and fail the build if they are missing or report the wrong worldgen version. While the spawn area is prepared, /stop (console), Ctrl+C and SIGTERM now take effect after the current chunk instead of after startup; a world stopped before its spawn was chosen is saved with initialized=0 so the next start searches again. Without the native generator only 3x3 spawn chunks are prepared, with per-chunk progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Chunks: section/heightmap/NBT encoding now works on whole lists (world/fastpack.py, output byte-identical to before) and the native generator output is read without quadratic concatenation, ~150 ms -> ~35 ms per new chunk. Chunks beyond the join radius are generated and sent nearest first in pipelined batches of 32, so the view fills in within seconds instead of everything arriving after ~1 minute. Crafting: the 2x2 inventory grid and the crafting table now work, with all vanilla 1.21.1 shaped/shapeless recipes (tags resolved, mirrored shapes, crafting remainders; tools/gen_recipe_data.py builds world/data/recipes.json). Result slot clicks, shift-crafting, number keys and dropping behave like vanilla; grids empty back into the inventory on close or logout. Clicks are answered like vanilla with only the slots the client predicted wrong (one state id per answer) instead of a full window each time, which raced with fast clicking. Leaves drop by the vanilla loot table (saplings 1/20, jungle 1/40, sticks 1/50, apples 1/200, Fortune-scaled; shears/Silk Touch keep the leaves) instead of always dropping a sapling or the leaves themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Mobs treated grass, flowers, torches and every other block without a
collision box as walls, so on vanilla terrain they got stuck within a
block and hostile mobs never got close enough to hurt anyone. Mob
physics now uses the collision data from blocks.json.
Damage follows vanilla: weapon damage/attack speed tables, attack
strength scaling instead of dropping clicks within 0.4 s, critical
hits, armor + toughness, protection enchantments, difficulty scaling of
mob damage, the 10-tick invulnerability window (for players and mobs)
and 3 s spawn invulnerability on join/respawn.
Region files were written concurrently by the event loop and chunk
worker threads, racing on the same .tmp file ("Failed to save region");
all region access is now serialized.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Block and entity drops now come from the vanilla 1.21.1 loot tables (tools/gen_loot_data.py -> world/data/loot_tables.json): Fortune and Looting formulas, Silk Touch, shears, random chances, crop ages, killed-by-player drops, explosion decay, sheep wool by colour. Blocks drop with bare hands unless vanilla requires the correct tool (blocks.json harvestTools); before, dirt, logs, sand etc. dropped nothing without a tool. TNT is primed into a TNT entity with an 80-tick fuse (flint and steel, redstone) instead of exploding instantly. Explosions use the vanilla ray algorithm with block blast resistance, chain-prime TNT, drop blocks through their loot tables, damage and push entities by exposure, and send the 1.21.1 Explosion packet (the old packet layout would make clients disconnect). 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.
概要
接在 #3 之后的修复与原版机制。仍在进行中,所以先开草稿。
打包与启动
terrain_gen、mob_ai等)。Nuitka 的--include-data-dir会静默跳过.exe/.dll/.so/.dylib,所以之前的打包版只能用很慢的 Python 生成器。现在改为显式列出这些文件,CI 打包前也会检查它们是否存在。stop/ Ctrl+C / SIGTERM 会立即生效。如果停服时出生点还没选好,会在level.dat里记为initialized=0,下次启动重新选。区块加载
world/fastpack.py),输出与之前逐字节一致。每个新区块从约 150 毫秒降到约 35 毫秒。合成
tools/gen_recipe_data.py生成),支持标签展开、左右镜像和合成剩余物(如空桶)。slotChangedCraftingGrid规则发送。伤害与生物
blocks.json的碰撞数据。Failed to save region),所有区域读写现在都串行执行。掉落(原版战利品表)
tools/gen_loot_data.py生成):blocks.json的harvestTools。之前泥土、原木、沙子等空手挖什么都不掉。TNT 与爆炸
测试
pytest:184 个测试全部通过。新增:tests/test_crafting_and_drops.py:配方匹配、合成窗口、差异同步、树叶掉落、编码器;进行中 / 已知问题
/setblock放的红石块不会触发相邻 TNT;红石引擎和生电相关特性(BUD、刷线机、刷钩机、0t 活塞)正在评估。instant_health等药水效果未实现。Generated by Claude Code