perf: tank and tainted crop lookups hoisted #27

Merged
layue13 merged 1 commits from perf/tank-crops-lookups into main 2026-11-07 06:13:31 +00:00
Owner

Requested by Ethyn · project thread

Closes #20, closes #22

行为不变的机械改动:

  • #20:TileTankBasic 与 TileOldReinforcedTank 每 tick 把上/下邻居各查一次,元数据由 connectionMeta(above, below) 一次算出(0 无邻、1 仅下、2 仅上、3 上下),只在不同时才写。原先四条 if 重复 16 次查询,其中 12 次冗余。
  • #22:TileTaintedCrops 土壤方块和元数据各取一次;群系只在 tick 达到最低阈值 3550 之后才查;同时删掉从未生效的反射掉落代码(作物已被置空气,且反射签名用 Integer.class 永远匹配不到)。
    新增 3 个单元测试(四种邻居组合的元数据、两个阈值、成长计数边界),并加入 JUnit 依赖。编译与测试通过。

🤖 Generated with Claude Code

<!-- claude-projects-attribution --> _Requested by **Ethyn** · [project thread](https://claude.ai/code/project/chan_01DUNCDJLEksDHKpX5X5cThi?thread=cmsg_01DUNCDJLEksDHKpX5X5cThiWWzw9g2ZbURExfCGHZcnLC)_ Closes #20, closes #22 行为不变的机械改动: - #20:`TileTankBasic` 与 `TileOldReinforcedTank` 每 tick 把上/下邻居各查一次,元数据由 `connectionMeta(above, below)` 一次算出(0 无邻、1 仅下、2 仅上、3 上下),只在不同时才写。原先四条 if 重复 16 次查询,其中 12 次冗余。 - #22:`TileTaintedCrops` 土壤方块和元数据各取一次;群系只在 tick 达到最低阈值 3550 之后才查;同时删掉从未生效的反射掉落代码(作物已被置空气,且反射签名用 `Integer.class` 永远匹配不到)。 新增 3 个单元测试(四种邻居组合的元数据、两个阈值、成长计数边界),并加入 JUnit 依赖。编译与测试通过。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
layue13 added 1 commit 2026-11-07 06:11:56 +00:00
perf: tanks and tainted crops stop re-querying the same positions each tick
Build / build (push) Skipped
Build / publish (push) Skipped
Build / build (pull_request) Successful in 1m25s
Build / publish (pull_request) Skipped
69fc32e3f6
Closes TDLM/thaumicadditions#20, closes TDLM/thaumicadditions#22

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
layue13 merged commit 12042a98d8 into main 2026-11-07 06:13:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TDLM/thaumicadditions#27