Skip to content

[1.4.5] Ported tile-entity updates#5207

Merged
JavidPack merged 4 commits into
tModLoader:1.4.5from
noahDP1911:TileEntityUpdatesPort
Jun 23, 2026
Merged

[1.4.5] Ported tile-entity updates#5207
JavidPack merged 4 commits into
tModLoader:1.4.5from
noahDP1911:TileEntityUpdatesPort

Conversation

@noahDP1911

Copy link
Copy Markdown
Contributor

What is the bug?

Terraria 1.4.5 only updates tile entities registered in TileEntity.UpdateEntities.
tModLoader directly added and removed modded tile entities from ByID and ByPosition, bypassing the new registration logic. Consequently, modded tile entities were not registered for updates.

How did you fix the bug?

Modded tile entities now require updates by default, preserving their previous behavior.
Placement, loading, and removal now use TileEntity.Add and TileEntity.Remove, keeping UpdateEntities, ByID, and ByPosition synchronized.
Documentation and tests were added for both updating tile entities and tile entities that opt out by setting RequiresUpdates to false.

Are there alternatives to your fix?

Mods could be required to set RequiresUpdates themselves, but this would silently break existing tile entities.
tModLoader could maintain a separate update loop, but using Terraria's existing registration methods avoids duplicating update behavior.

@Chicken-Bones

Copy link
Copy Markdown
Member

Please remove the tests, they don't add much value relative to their maintenance cost. We will discuss the default for RequiresUpdates

@Chicken-Bones

Copy link
Copy Markdown
Member

You can initialize the default value of RequiresUpdates to LoaderUtils.HasOverride(this, e => e.Update)

@Chicken-Bones Chicken-Bones requested a review from JavidPack June 23, 2026 07:14
@JavidPack JavidPack merged commit 52c5058 into tModLoader:1.4.5 Jun 23, 2026
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.

3 participants