Blueprint

Blueprint

72M Downloads

ConcurrentModificationException during tree generation when using C2ME and Atmospheric/Upgrade Aquatic

lgbtaye777 opened this issue · 14 comments

commented
# `ConcurrentModificationException` in `BlueprintTreeFeature` during world generation (e.g., with Upgrade Aquatic, Atmospheric)

## Description

I’m encountering consistent crashes during world generation with Blueprint (v7.1.3), particularly when used alongside **Upgrade Aquatic** and **Atmospheric**. The crashes are caused by a `ConcurrentModificationException` inside `BlueprintTreeFeature`, triggered during feature placements like `upgrade_aquatic:river_tree` and `atmospheric:trees_rainforest_basin`.

Notably, **the crash still occurs even when C2ME is completely disabled**, suggesting the issue is not exclusive to multithreaded worldgen but a more general lack of thread-safety (possibly due to parallel operations initiated by other mods or even single-threaded access violations).

## Environment

- Minecraft: 1.20.1
- Blueprint: 7.1.3
- Upgrade Aquatic: [insert version if known]
- Atmospheric: [insert version if known]
- C2ME: Tested both enabled and fully disabled — crash occurs in both cases
- Sinytra Connector: Present

## Crash Snippet

```java
java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597)
    at com.teamabnormals.blueprint.common.levelgen.feature.BlueprintTreeFeature.m_142674_(BlueprintTreeFeature.java:62)
    at net.minecraft.world.level.levelgen.feature.ConfiguredFeature.m_224953_(ConfiguredFeature.java:537)

This occurred during placement of:

  • upgrade_aquatic:river_tree
  • atmospheric:trees_rainforest_basin

Steps to Reproduce

  1. Use Blueprint with Upgrade Aquatic or Atmospheric.
  2. Generate or explore world (regardless of C2ME usage).
  3. Crash occurs during chunk generation when certain tree features are placed.

Notes

  • The issue is not exclusively caused by C2ME.
  • The crash appears to be due to unsafe modification of collections during iteration in BlueprintTreeFeature.
  • Consider implementing synchronized access or safer iteration to support a broader range of setups and maintain stability.

Thank You

Thank you for your great work on Blueprint — it's a crucial tool in the modding ecosystem. Let me know if you'd like full logs or a test pack to reproduce the issue.






commented

I've also been experiencing this issue, though infrequently and without C2ME installed. I think the crash might occur on a per-world basis. For example, the seed -5665344453688738026 seems safe from crashes. The below crash log is proof that I'm experiencing the issue, as well as my modlist.

crash-2025-05-15_14.23.35-server.txt

commented

The seed 7840527658051580446 causes a crash when using /locate to find an atmospheric:rainforest, but rejoining the world seems to solve the issue.

crash-2025-05-15_14.52.11-server.txt

commented

I am unable to reproduce this issue with the mods you described. We do not maintain support for Sinytra Connector, so any issues only on that platform are almost always very low priority.

As I stated in this PR, #270 (comment), a proper fix for the issue would require breaking changes.
If I could reproduce the issue in normal environments, I would commit a band-aid fix, but I cannot confirm the issue exists outside of C2ME or other mods performing unique multi-threaded worldgen.

In 1.21.1, the blueprint tree feature was refactored to be thread-safe.

commented

Any updates on this? Was it reproduceable in the dev environment?

commented

@BodhiSmith13 The crash report says you're on Sinytra Connector, which we do not guarantee stable support for. Additionally, you're using Distant Horizons, which may be the culprit, as it alters how the game loads chunks.
The mod causing the crash is also not Blueprint; it's a mod using Blueprint.

I am unable to reproduce this in a dev environment with our biome mods and Blueprint.

commented

@SmellyModder Which features can cause this crash? Is it to specific to certain features or is it any feature extending the BlueprintTreeFeature class?