Follow-up to the closed thaumicadditions#20 ("not worth it"). Part of #20 was fixed since (tank meta helper, crop and singularity lookups, see #27/#28/#30), but TileTankBasic.updateEntity still asked the world for the tile above up to 3x (var4, the cast in the eject branch, canAccept path) and the tile below up to 2x per tick. Each neighbour tile is now read once, after the taint-explosion branch exactly where the first lookup used to be, so nothing can have changed between the read and its uses.
Dimensions
before
after
world tile lookups per tank per tick
2 normally, 3 with a tank below, 4-5 on an eject tick
2
results (vis/taint of every tank in a stack)
-
identical over 40 random stacks x 30 ticks
memory / client / startup / latency
-
no change (two locals)
Tests
TileTankBasicLookupTest runs the old lookup sequence (inline reference) and the new method side by side on counting worlds: tank states match after every tick, lookups never more.
<!-- claude-projects-attribution -->
_Requested by **Ethyn** · [project thread](https://claude.ai/code/project/chan_01DUNCDJLEksDHKpX5X5cThi?thread=cmsg_01DUNCDJLEksDHKpX5X5cThiWWzw9g2ZbURExfCGHZcnLC)_
Re-check of closed #20
## What
Follow-up to the closed thaumicadditions#20 ("not worth it"). Part of #20 was fixed since (tank meta helper, crop and singularity lookups, see #27/#28/#30), but `TileTankBasic.updateEntity` still asked the world for the tile above up to 3x (`var4`, the cast in the eject branch, `canAccept` path) and the tile below up to 2x per tick. Each neighbour tile is now read once, after the taint-explosion branch exactly where the first lookup used to be, so nothing can have changed between the read and its uses.
## Dimensions
| | before | after |
|---|---|---|
| world tile lookups per tank per tick | 2 normally, 3 with a tank below, 4-5 on an eject tick | 2 |
| results (vis/taint of every tank in a stack) | - | identical over 40 random stacks x 30 ticks |
| memory / client / startup / latency | - | no change (two locals) |
## Tests
TileTankBasicLookupTest runs the old lookup sequence (inline reference) and the new method side by side on counting worlds: tank states match after every tick, lookups never more.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
updateEntity asked the world for the tile above up to three times and the tile
below up to two times per tick; the blocks around cannot change between those
calls (a taint explosion earlier in the tick is handled before the first
lookup), so each is read once. Results identical, pinned by a test that runs
the old lookup sequence next to the new one.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Requested by Ethyn · project thread
Re-check of closed #20
What
Follow-up to the closed thaumicadditions#20 ("not worth it"). Part of #20 was fixed since (tank meta helper, crop and singularity lookups, see #27/#28/#30), but
TileTankBasic.updateEntitystill asked the world for the tile above up to 3x (var4, the cast in the eject branch,canAcceptpath) and the tile below up to 2x per tick. Each neighbour tile is now read once, after the taint-explosion branch exactly where the first lookup used to be, so nothing can have changed between the read and its uses.Dimensions
Tests
TileTankBasicLookupTest runs the old lookup sequence (inline reference) and the new method side by side on counting worlds: tank states match after every tick, lookups never more.
🤖 Generated with Claude Code