Subtle Effects Threads Fix

Quick rating

Community listing page, reviews here may not be monitored by the author.

Subtle Effects Threads Fix

No reviews yet

Fixes the "Accessing LegacyRandomSource from multiple threads" crash caused by Subtle Effects biome particles on NeoForge 1.21.1.

Mod Loaders
Minecraft

About

Description

## Subtle Effects Thread Fix

**The definitive fix for the `Accessing LegacyRandomSource from multiple threads` crash caused by Subtle Effects on NeoForge 1.21.1.**

---

### The Problem

When using **Subtle Effects** together with modern optimization mods (Sodium, Flywheel, ScalableLux, ModernFix, etc.) or simply with a heavily loaded client + integrated server, the game can randomly crash with:


The stacktrace almost always points to:

`einstein.subtle_effects.ticking.biome_particles.BiomeParticleManager.tickBiomeParticles`

This happens because Minecraft’s `LegacyRandomSource` is **not thread-safe**, and Subtle Effects was accessing it from a context where multiple threads could touch it.

---

### The Solution

This mod applies two layers of protection:

1. **Primary fix**  
   Redirects `Level#getRandom()` / `Level#random()` calls inside `tickBiomeParticles` to a proper **thread-safe** `RandomSource` (ThreadLocal).

2. **Safety net**  
   If any `IllegalStateException` related to `LegacyRandomSource` still escapes, it is caught and that frame’s biome particle tick is simply skipped. The game continues running normally.

Result: **no more crashes**, while keeping biome particles working in the vast majority of cases.

---

### Features

- Soft (optional) dependency on Subtle Effects — does nothing if the mod is not present
- Client-side only
- Zero configuration
- Extremely lightweight
- Fully compatible with heavy optimization packs

---

### Installation

1. Install NeoForge 1.21.1
2. Install Subtle Effects
3. Install this mod
4. Launch the game

No configuration needed.

---

### Compatibility

- Minecraft: **1.21.1**
- Loader: **NeoForge**
- Soft dependency: **Subtle Effects**

---

### Credits

Made for the **Perfection Rework** visual stack.  
Inspired by the original Subtle Fix concept.

---

### License

MIT