Skip to content

Preserve NBT data for uninitialized ManagedGridNodes - #8782

Open
Mqrius wants to merge 1 commit into
AppliedEnergistics:mainfrom
Mqrius:main
Open

Preserve NBT data for uninitialized ManagedGridNodes#8782
Mqrius wants to merge 1 commit into
AppliedEnergistics:mainfrom
Mqrius:main

Conversation

@Mqrius

@Mqrius Mqrius commented Feb 1, 2026

Copy link
Copy Markdown

When the world is loaded, ManagedGridNodes.loadFromNBT(tag) gets called and NBT data gets stored in initData because there is no actual Node yet to save it to. Later on createNode(initData) is called and loads the data fully.

The problem is that before createNode is actually called minecraft triggers another saveToNBT. (I believe this happens when it promotes the proto-chunks to full chunks during world load)
Currently that save cycle does not include the data in initData, so it gets lost when afterwards another loadFromNBT happens.

This PR saves the initData to the CompoundTag if there is no node but there is initData. (initData is wiped upon initialization, so this is safe)

--

I noticed this bug because SpatialIOPortBlockEntity objects would forget their owningPlayerId when logging out and back in, but it likely affects other data as well.

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