promotional bannermobile promotional banner

Weather, Storms & Tornadoes - Concurrent Packet Fix

Fixes a long-standing ConcurrentModificationException crash/disconnect in Weather2 caused by unsafe multi-threaded NBT packet encoding.

File Details

weather2patch-1.1.1-neoforge-1.21.jar

  • R
  • Mar 22, 2026
  • 3.35 KB
  • 3.3K
  • 1.21.1+3
  • NeoForge

File Name

weather2patch-1.1.1.jar

Supported Versions

  • 1.21-Snapshot
  • 1.21.1-Snapshot
  • 1.21.1
  • 1.21

Curse Maven Snippet

NeoForge

implementation "curse.maven:weather-storms-tornadoes-concurrent-packet-fix-1491974:7795252"
Curse Maven does not yet support mods that have disabled 3rd party sharing

Learn more about Curse Maven

Changelog

[1.1.1]

Changed

  • Replaced synchronized(this) snapshot with a retry loop -- synchronized was ineffective because Weather2 writes to CompoundTag without holding any lock, meaning the CME could still occur during the copy itself
  • Switched snapshot collection from new HashMap<>(tags) to new ArrayList<>(tags.entrySet()) to avoid redundant map construction overhead
  • Added retry cap (MAX_RETRIES = 100) -- if exceeded, writes an empty tag and logs a warning instead of looping indefinitely
  • Switched logger from java.util.logging to Log4j2 (LogManager) for proper NeoForge console output

Added

  • Console log on first patch activation: [weather2patch] CompoundTag thread-safety patch is active.
  • Console warning if retry cap is exceeded: [weather2patch] CompoundTag.write() hit MAX_RETRIES