Lithium (Fabric)

Lithium (Fabric)

22M Downloads

Theoretical DimThread mod incompatibility

2No2Name opened this issue ยท 2 comments

commented

Version Information

Lithium 0.7+

Expected Behavior

There should be no unsynchronized mixed read/write access to static variables in code that is accessed during world ticking.

Actual Behavior

There is unsynchronized mixed read/write access to static variables in subclasses of me.jellysquid.mods.lithium.common.entity.tracker.nearby.SectionedEntityMovementTracker. There is one write per created world (dimension) and several reads when ticking hoppers. This could lead to crashes or hoppers interacting with entities from the wrong world (dimension).

Reproduction Steps

Install a mod that runs each world on a separate thread. Have hoppers in the worlds. Be very unlucky.

Other Information

This is likely only a rare theoretical issue. But since we want to be compatible with DimThread (https://github.com/WearBlackAllDay/DimensionalThreading), this should be fixed eventually. Temporary workaround could be to disable the hopper optimizations.

commented

Fix should be either using a copy on write datastructure to store the world-> collection mapping or store the collection as a field in World.

commented

Fixed in local dev branch, will push after testing other changes