HomeJavaModsCrossRegionBridge
ModsJava

CrossRegionBridge

A lock-free, zero-allocation cross-region messaging & task bridge for Folia and Paper.

⬇ Download on Modrinth

CrossRegionBridge (CRB)

CrossRegionBridge (CRB) is an ultra-high-performance, lock-free, and zero-allocation developer framework designed to act as an asynchronous data and task bridge between independent region tick-loops on Folia servers, with a transparent fallback implementation for classic Paper servers.

If you are developing multi-threaded plugins, cross-region features, or complex minigames for Folia, CRB solves the complex threading issues of region-to-region communications safely and efficiently.


Key Features


How it Works under the Hood

CRB implements a highly optimized On-Demand Tick Scheduling mechanism:

  1. When Region A sends a query to Region B, the message is pushed lock-free into Region B's mailbox.
  2. If Region B's mailbox was empty, a task is scheduled on Folia's RegionScheduler using Compare-And-Swap (CAS).
  3. Region B processes the mailbox during its next tick, completes the query, and routes a ResponseEnvelope back to Region A.
  4. Region A processes the response during its own tick, executing your developer callback safely.

This reactive scheduling ensures absolute zero CPU overhead on inactive or empty regions.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more