Initialize client cubes before load events - #111
Conversation
DarkShadow44
left a comment
There was a problem hiding this comment.
If I understand correctly, Angelica makes a snapshot on cube load, then continues to use that snapshot. Angelica seems to use the same loop in fillChunk but we need it for cubes as well. Correct?
-
We might need to deal with stale tile entities. Vanilla
Chunk.fillChunkends with a stale-TE pass, shouldn't we also iterate withshouldRefreshand invalidate TEs? -
Not a new issue, but Angelica wraps chunkTileEntityMap in a ConcurrentTileEntityMap and has a CC-specific constructor for it, but that only locks the ColumnTileEntityMap. This unfortunately just forwards into Cube.cubeTileEntityMap which is a plain HashMap. Seems like ConcurrentModificationException waiting to happen.
-
Can't we get rid of
wasLoadedby skippingsetCubeLoadedandworld.getLightingManager().onCubeLoad(cube);client side and at the end ofprocessdoingif (!cube.isCubeLoaded()) { cube.onCubeLoad(); }Seems like it should work
|
I was investigating this and I noticed that the tile physically isn't created in the client world until the chest block receives a block update (typically from a player interacting with it somehow). Chests don't have description packets so the tiles aren't created when a cube first syncs. |
a3fd1c1 to
5dd26c5
Compare
|
I changed it according to DarkShadow44's suggestions |
|
Seems like it should work just fine, although I only looked at the code and didn't test. |
Fixed issue where tile entities such as chests would be invisible after reloading the world with Angelica. CubicChunks posted CubeEvent.Load before decoding the cube, causing Angelica to load and cache it before tile entities were initialized
Tile entities are now initialized before posting the load event