Skip to content

Merge Alchemy 1.21.1 Branch - #192

Open
alchemyyy wants to merge 5 commits into
AxalotLDev:multiloader-1.21.1from
alchemyyy:multiloader-1.21.1
Open

Merge Alchemy 1.21.1 Branch#192
alchemyyy wants to merge 5 commits into
AxalotLDev:multiloader-1.21.1from
alchemyyy:multiloader-1.21.1

Conversation

@alchemyyy

Copy link
Copy Markdown
Contributor

I have 5 commits for review and possible cherrypicking.

Prevent off-thread block entity chunk loads is in my opinion particularly important. It addresses an issue type I've seen before with shulkers, which iirc is mitigated with The hardcoded BLOCKED_ENTITIES list

Which works to solve this cyclic chunk load wait / deadlock when chunks get their initial lighting pass:

  1. Lighting worker calls getShape or something similar
  2. Vanilla or Mod call getBlockEntity.
  3. Async bypasses vanilla's off-thread null.
  4. getBlockEntity calls getChunkAt.
  5. The worker waits for a FULL chunk whose lighting depends on that worker.

Backport commits newer than 7967c3f on multiloader-26.2 to 1.21.1

## Commits Backported

1. `30eed36` - update README.md
2. `a87a4d2` - update config description
3. `ab7f5ea` - update api javadoc
4. `0422e65` - update api version
5. `8eb89d8` - more fixes and improvements
6. `74ee738` - update api version
7. `fdf1990` - fix spawn rate in other dimensions
8. `f91d2e4` - Fix issue with stacked trade (clumps mod)
9. `4ed0347` - restrict async chunk lookup handling to async-tick pool threads
10. `425f846` - fix async spawn (rollback) && FOREGROUND tasks
11. `d904903` - update CHANGELOG.md

## Changes
- Rework entity processing with adaptive spatial batching, foreground/background task priorities, main-thread queue draining, and safer executor fallbacks.
- Integrate despawn checks into entity batches, keep players ticking outside normal entity distance checks, and prevent removed entities from continuing through despawn or tick work.
- Fix compatibility with stacked-trade behavior used by mods such as Clumps.
- Restrict asynchronous chunk interception to worker threads to avoid affecting unrelated mod threads.
- Add a per-thread last-chunk cache and timeout diagnostics for asynchronous chunk retrieval.
- Rebuild natural-spawn state synchronously each tick before dispatching spawn work.
- Add safe synchronous rollback when asynchronous spawn processing fails.
- Restore natural spawning in dimensions whose cached nearby-player collection is empty.
- Use thread-local spawn random sources and synchronize shared mob-count and local mob-cap state.
- Prevent entity tick work from being delayed behind background spawn tasks.
- Fix Lithium block-change callback races and synchronize additional masked-list reads.
- Fix hopper minecart container writes racing other item transfers.
- Update FastUtil synchronization targets and compatibility mixin cancellation rules.
- Fix all three sensor overwrite visibility mismatches that prevented the server from starting.
- Improve automatic worker-thread sizing so capacity remains available for the server thread and garbage collection.
- Update the API from 1.0.4 to 1.0.6.
- Correct concurrent primitive-map behavior, iterator handling, collection conversions, and default-return-value semantics.
- Make concurrent sorted-set range operations return live backed views instead of detached copies.
- Expand API documentation for concurrent collection wrappers and adapters.
- Add the required access widener, access transformer, and mixin registrations for spawn-state access and new synchronization hooks.
- Refresh the README with loader requirements, configuration details, command documentation, compatibility notes, and project links.
- Preserve the 1.21.1 mod version and intentionally omit the 26.2-only version bump, PalettedContainerMixin, SpawnStateMixin, and older unrelated upstream branch state.

## Validation

- Pass the complete API, common, Fabric, and NeoForge clean build.
- Start Fabric 1.21.1 with Lithium and the complete mixin configuration.
- Summon and tick 32 zombies with asynchronous spawning enabled.
- Shut down cleanly without errors, exceptions, or mixin application failures.
 Stop polling main-thread chunk tasks after parallel entity batches complete.
Preserve vanilla block entity lookup behavior for external workers while restricting Async tick workers to existing block entities in already-loaded FULL chunks. Make block entity storage concurrent, keep `getChunkNow` non-scheduling.
@ali-afk

ali-afk commented Aug 9, 2026

Copy link
Copy Markdown

Hi, this pull request is incompatible with Chunksmith, the chunk pregenerator mod. Freezes my server when i run the pregeneration.

@alchemyyy

Copy link
Copy Markdown
Contributor Author

@ali-afk Thanks for giving this a test drive!

I'd love to get some additional details so I can properly diagnose and debug the issue. The fastest way would be attaching some logs I could read through.

In addition to that, I'd like to know if you've run the same test with the current modrinth version, or any version besides the one in this PR, and if that worked. I'm also curious if the issue seems to only happen with Chunksmith, or if you've encountered the freeze generating terrain normally too.

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.

2 participants