Skip to content

Regionized World Storage - #60

Open
Biquaternions wants to merge 1 commit into
SparklyPower:ver/26.2from
Biquaternions:feat/region-world-data
Open

Regionized World Storage#60
Biquaternions wants to merge 1 commit into
SparklyPower:ver/26.2from
Biquaternions:feat/region-world-data

Conversation

@Biquaternions

Copy link
Copy Markdown

This PR implements a GenericWorldData and TickWorldScheduler classes, analogous to Folia's RegionizedWorldData and TickRegionScheduler respectively.

For this to work, TickThread.ServerLevelTickThread now receives a ServerLevel as an argument in its constructor and stores it as a final variable.
currentlyTickingLevel is no longer assigned here, as it always holds the same value (each world has its own independent thread).
image

This implementation fixes two issues:

  1. A race condition in HopperBlockEntity and BlockEntity where worlds override the skip ticks optimization, and ignoreBlockEntityUpdates randomly ignores block updates in other worlds.
  2. A race condition in RedstoneWireTurbo and RedStoneWireBlock where, when using the vanilla redstone implementation, some worlds might throw "too many chained neighbors", due to a race condition in shouldSignal.

The new TickWorldScheduler allows retrieving the world data without relying in ThreadLocal, it retrieves the world local signal handler and hopper optimization flags, or fallbacks to the main thread ones if any is called outside the world tick.
image

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