Skip to content

Load cubes when fetching tile entities from unloaded cubes - #100

Merged
RecursivePineapple merged 2 commits into
masterfrom
tile-cube-loading
Aug 13, 2026
Merged

Load cubes when fetching tile entities from unloaded cubes#100
RecursivePineapple merged 2 commits into
masterfrom
tile-cube-loading

Conversation

@RecursivePineapple

@RecursivePineapple RecursivePineapple commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

There was an odd corruption bug related to GT pipes, but it also applied to some machines. It was caused by one cube remaining loaded while another unloads. When a pipe tried to push fluids into an unloaded cube, it would check for an existing tile in that position via Chunk.func_150806_e. Since the target cube was unloaded, it would see no tile. This is because I previously changed ColumnTileEntityMap to only check loaded cubes for tiles. Since func_150806_e saw no tiles in the location, it would then call getBlock to check if the position should have a tile. getBlock loads the tile, and returns gt.blockmachines. hasTileEntity returns true for the given meta, so func_150806_e creates a new (invalid) tile for the given meta and puts it in the TE map, inserting it into the cube. From that point on, the tile in that location is no longer valid.

There were two ways I could've fixed this. The first is what I chose to do - I restored ColumnTileEntityMap to its old behaviour of loading cubes. The other solution would be to no-op func_150806_e by returning null when the target cube was unloaded, but I figured this would cause similar issues so I went with the first solution.

fixes: #78

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@ShadowReaper420

Copy link
Copy Markdown

Trying to figure out what caused this nearly drove me insane

@RecursivePineapple RecursivePineapple added Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. Merge Into Prerelease PR will be added to -pre releases (via the dev branch). labels Jul 25, 2026
@RecursivePineapple
RecursivePineapple merged commit c6fdd54 into master Aug 13, 2026
1 check passed
@RecursivePineapple
RecursivePineapple deleted the tile-cube-loading branch August 13, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. Merge Into Prerelease PR will be added to -pre releases (via the dev branch).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GT machines lose their meta/machine id

3 participants