Repository navigation
Fix parts not being reattached to their network after chunk reloads - #1786
Merged
Merged
Conversation
When a chunk with a cable is loaded, the network lazily revalidates its updated parts. The first such part links the cable's network carrier, after which revalidateNetworkElements skips the cable. Other parts on that cable were therefore never passed afterNetworkReAlive, and parts that are not updated, such as Integrated Tunnels interfaces, were not even revalidated. For example, an energy interface sharing a cable with an omni-directional connector stopped accepting energy after a reload, until the network was reinitialized with a wrench. The part that links the network carrier now also revalidates the other parts at its position. Closes #1785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeSuG8QxSiLg19VkMZScf3
rubensworks
commented
Nov 9, 2026
…NetworkElement.java
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.
Closes #1785
Cause
When a chunk containing a cable loads, its parts come back with new states that still need to be attached to the network (
afterNetworkReAlive).BlockEntityMultipartTicking#onLoadleaves revalidation to its ticker.Network#isValid→PartNetworkElement#revalidate). That links the cable's shared network carrier, and only that part getsafterNetworkReAlive.NetworkHelpers#revalidateNetworkElementsis never called for it.As a result:
afterNetworkReAlive.In the reported setup, an Integrated Tunnels energy interface shares a cable with an omni-directional connector (an updated part). After a reload the interface exposes no energy capability, so Oritech generators can no longer push energy into it. A wrench click reinitializes the network, which is why that worked around it.
Fix
The part that links the network carrier during revalidation now also revalidates the other parts at its position and calls
afterNetworkReAliveon them. Parts revalidated throughNetworkHelpers#revalidateNetworkElementsdon't get a secondafterNetworkReAlive, because the carrier is already linked by then.Reproduction and verification
Reproduced on a 26.1.2 dedicated server running Integrated Tunnels 1.13.3, Oritech 2.0.0-exp12 and NeoForge 26.1.2.126. The setup was an Oritech creative storage pushing into an energy interface, linked by omni-directional connectors to a second energy interface feeding an Oritech large storage.
Tests
testNetworkRevalidateAllPartsAtPosition. It recreates the part states as a chunk reload would, then lets the first part relink the cable. It fails without the fix ("Second part was not attached to the network") and passes with it../gradlew buildpasses../gradlew runGameTestServer: all 1084 required tests pass.Generated by Claude Code