Skip to content

Fix TileDynamoMJ tech debt: cache biome + safe overheat shutdown - #1

Open
ghshhf wants to merge 1 commit into
8.0.x-1.12.2from
fix/dynamo-mj-techdebt
Open

Fix TileDynamoMJ tech debt: cache biome + safe overheat shutdown#1
ghshhf wants to merge 1 commit into
8.0.x-1.12.2from
fix/dynamo-mj-techdebt

Conversation

@ghshhf

@ghshhf ghshhf commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses three TileDynamoMJ tech-debt items from the known-tech-debt list:

  1. Biome cache (getBiome()): previously called world.getBiome(getPos()) on every invocation. The tile position is fixed so the biome never changes — now cached in a field and invalidated in readFromNBT.
  2. Safe overheat shutdown (addPower): the old // TODO: turn engine off was commented-out destructive code (engine explosion / block removal). Replaced with a non-destructive shutdown — when OVERHEAT, the engine stops accepting further RF input and just keeps cooling (already the behaviour guarded in update()). No blocks are destroyed.
  3. Stale comments: removed two // TODO: sync gui data markers — heat and currentOutput are already synced to the client via NET_GUI_DATA.

Testing

Compiled successfully with ForgeGradle (./gradlew compileJava, exit 0). No gameplay logic change for the non-overheated path; overheat path now idles instead of doing nothing/destroying the block.

…eat shutdown)

- Cache the biome lookup in getBiome() instead of querying world every call
  (was flagged TODO: Cache this!). Tile position is fixed so the result never
  changes; cache is invalidated in readFromNBT.
- Replace the disabled destructive overheat behaviour (engine explosion / block
  removal) with a safe shutdown: when overheated the engine stops accepting
  further RF input. It keeps cooling in update() and auto-resumes once heat
  drops below the overheat threshold. Matches the existing "don't burn while
  overheated" guard.
- Remove two stale "TODO: sync gui data" comments: heat/currentOutput are already
  synced via NET_GUI_DATA in writePayload/readPayload.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

JUnit Test Report

 34 files  ±0   34 suites  ±0   4s ⏱️ ±0s
100 tests ±0  100 ✅ ±0  0 💤 ±0  0 ❌ ±0 
159 runs  ±0  159 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d18f35a. ± Comparison against base commit d83b8c9.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant