Repository navigation
[release-v1.2.1]原版红石、放置规则、区块加载、合成、伤害、战利品表与 TNT - #4
Merged
Merged
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
Replace the approximate redstone engine (full recompute of a component registry every other tick) with a port of the vanilla 1.21.1 update model in world/rs: setBlock with update flags, onPlace/onRemove, block updates in W,E,D,U,N,S order, shape updates, scheduled ticks ordered by (tick, priority, sub-tick), block events and moving-piston block entities, run every game tick in vanilla phase order. Components follow the vanilla classes: redstone wire (connection shapes, weak/strong power via shouldSignal, update order from Java HashSet iteration), torches with burnout, repeaters (delay, locking, priorities), comparators (compare/subtract, container/cauldron/composter/cake readings), observers, levers, buttons, pressure plates, redstone lamps, TNT, note blocks, doors/trapdoors/fence gates, dispensers/droppers, hoppers, powered/activator rails and pistons (structure resolver with slime/honey, push limit 12, push reactions, moving pistons, finalTick, fast retraction). Quasi-connectivity, BUD pistons and 0-tick behaviour emerge from this instead of being special-cased; scheduled ticks survive restarts. Clients get Block Action packets for piston animations. Placing blocks now uses vanilla getStateForPlacement rules (piston, observer, repeater, comparator, hopper facing; lever/button faces; wall torches; slab/stair halves; log axes; trapdoors; doors and beds with both halves; signs; waterlogging) and items whose block has another name (redstone -> redstone_wire, string, seeds, ...) can be placed at all. Every edit through world.editing (placing, breaking, /setblock, /fill, /clone, explosions) notifies the engine; /setblock accepts name[prop=val]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
TripWireHookBlock.calculateState (cached line states written back, 10-tick recheck when the line changes), tripwire connections, update sources and entity detection, as in vanilla, so string/hook behaviour under pistons follows the same code path as the vanilla server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
TNT dupers work again: pistons capture the pushed states before moving them, so a budded TNT primed by an update inside that window is still placed by the moving piston. The missing pieces were vanilla details: coral fans are pushable (MC-133541) and pop without support, rails are pushable, and powered/detector/activator rails update their surroundings when removed (BaseRailBlock). A layout search found duplicating layouts; one is kept as a regression test. Explosions are computed (rays, exposure, loot rolls) on a dedicated explosion thread pool regardless of the multithreading setting, and applied back on the server thread (damage, knockback, block changes, redstone updates, drops, packets), skipping blocks that changed in the meantime. Queued explosions run as background tasks in order, so the game tick no longer waits for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
native/vanilla is a line-by-line port of world/rs (setBlock, block and shape updates, scheduled ticks, block events, moving pistons; BUD, quasi-connectivity, 0-tick and TNT duplication emerge the same way), loaded in-process through ctypes. Adds the vanilla hopper block entity (cooldowns, push then pull, locking, sided furnace slots, item pickup) and computes explosion rays and exposure in C++ on the explosion thread. The Python engine stays as fallback and reference: every redstone test is rerun on the native engine and 300 random circuits are compared tick by tick. CMake, build scripts and CI build and package the library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
Double chests: vanilla placement joins a single chest beside the new one, ChestBlock shape updates join and split the halves (both engines), a 54-slot window opens, and hoppers and comparators see one compound container with the right half first. Hopper minecarts: minecart entities follow straight, curved and sloped rails with powered-rail boost and braking; a hopper minecart sucks one item per tick from the container above (or picks up items) unless it stands on a powered activator rail; hoppers push into and pull from minecarts next to them; players open and break them; they are saved with the world. Composters: hoppers fill them with the vanilla compost chances, level 7 becomes ready after 20 ticks, hoppers below take the bone meal; players compost and empty them by hand. The native hopper code now tags every slot with the inventory that owns it (block container, entity, composter), so all views stay consistent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
… release from PR title Minecarts: players ride plain minecarts (interact to get in, W pushes the cart, sneak gets out; Set Passengers and Player Input), walking into a minecart pushes it, minecarts push each other apart (AbstractMinecart.push), moving minecarts are synced every tick. Detector rails power while a minecart is on them and comparators read a container minecart (both engines). Brewing stands get their 5-slot container and window, and hoppers follow the vanilla faces: ingredients from above, bottles and blaze powder from the side, potions out of the bottom. CI: merging a pull request whose title contains [release-vX.Y.Z] tags the merge commit vX.Y.Z and publishes the stable release in the same workflow. CHANGELOG gets a 1.2.1 section for everything after v1.2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu
hekuo5310
marked this pull request as ready for review
November 18, 2026 07:58
hekuo5310
added a commit
that referenced
this pull request
Nov 18, 2026
[release-v1.2.1]原版红石、放置规则、区块加载、合成、伤害、战利品表与 TNT
hekuo5310
pushed a commit
that referenced
this pull request
Nov 20, 2026
main and this branch share the same history from PR #4 onward only through the squashed merge; the conflicts were the same files written in both histories. Resolved in favour of this branch. main still referred to pumpkin-ref/, which is gone; those references are removed here. Co-Authored-By: Claude <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 之后的修复与原版机制。仍在推进,所以保持草稿。
本次变更
admin/web.py、其测试以及web-admin-*配置项。终端控制台、RCON 和权限系统不受影响。max(左, 右) * 2 + 1,合并时两边的惩罚计入费用(与原版一致)。anvil-too-expensive-limit(默认true,即原版行为)。设为false后,费用达到 40 级也能取出,只要等级足够。potion_contents组件)。id 来自注册表的注册顺序,仓库里world/data/potions.json只保存名字和顺序。药效尚未实现。附魔与附魔书(上一轮)
tools/gen_enchantment_data.py生成world/data/enchantments.json)。容器与交互(前几轮)
红石与引擎(按原版 1.21.1 重写,
world/rs/;C++ 原生引擎在native/vanilla/)setBlock、原版更新顺序、形状更新、计划刻、方块事件、移动中活塞。其他
getStateForPlacement;TNT 与爆炸按原版实现,爆炸在独立线程中计算。[release-vX.Y.Z]的 PR 时自动打 tag 并发布正式版(tag 已存在时只发预发布);直接推送v*tag 照旧。测试
pytest:265 个通过,1 个跳过(只检查 Python 引擎内部状态)。tests/test_enchanting.py:附魔和药水的编码往返;附魔台和铁砧的全部交互;先前工作惩罚;费用上限开关(开和关,创造模式);配置文件读取。tests/test_native_engine.py:红石测试在 C++ 引擎上重跑;随机电路逐刻比对;爆炸射线比对;漏斗、堆肥桶、酿造台、矿车、探测铁轨。已知限制
🤖 Generated with Claude Code
https://claude.ai/code/session_01MqNsCYYKLCUPjt3r1MFKgu