promotional bannermobile promotional banner

BlockSwap Reforged

BlockSwap mod Reforged for newer minecraft versions
Back to Files

blockswap-neoforge-1.21.1-beta-1.1.jar

File nameblockswap-neoforge-1.21.1-beta-1.1.jar
Uploader
BlackBroodBlackBrood
Uploaded
Nov 9, 2026
Downloads
9
Size
274.3 KB
Mod Loaders
NeoForge
File ID
9525795
Type
B
Beta
Supported game versions
  • 1.21.1
  • 1.21

Curse Maven Snippet

NeoForge

implementation "curse.maven:blockswap-reforged-1754125:9525795"

Learn more about Curse Maven

What's new

Key Features & Additions

1. Natural Generation Only Mode (onlySwapNaturalGeneration)

  • New Configuration Option: Added the onlySwapNaturalGeneration boolean setting to block_swap.json5 (default: false for backwards compatibility).
  • Behavior when true:
    • Swapping applies strictly during world generation: terrain noise, surface blocks, ore features, trees, vegetation, and structure generation are swapped per configuration.
    • Live gameplay placement is never swapped:
      • Player block placement (Survival, Creative, Adventure).
      • Piston movements and pushing.
      • Falling blocks (sand, gravel, concrete powder).
      • Liquid interactions and flowing fluids.
      • Bonemeal growth.
      • Dispenser actions.
      • Commands (/setblock, /fill).
    • Previously generated chunks remain untouched; only new chunks generated while the option is enabled are swapped.
  • Behavior when false:
    • Preserves original Block Swap behavior identically: both natural worldgen and live placement are swapped with full block state property remapping intact.

Improvements & Architecture

2. Re-Entrant Live Placement Tracking

  • Implemented a lightweight thread-local execution tracker in Swapper.java.
  • Wrapped Level.setBlock so calls delegating downward into chunk storage palette sections (LevelChunkSection.setBlockState) reliably differentiate live block placement from ProtoChunk world generation.
  • Added a server tick pre-hook in BlockSwap.java resetting live placement depth at the beginning of each tick to guarantee zero context leakage across ticks.

3. Forgiving Configuration Parser

  • String Booleans & Numbers: BlockSwapConfig.java now accepts "true", "false", "yes", "no", 1, and 0 in addition to raw JSON boolean primitives.
  • Key Aliases: Flexible key detection supports onlySwapNaturalGeneration, only_swap_natural_generation, naturalOnly, natural_only, onlyNaturalGeneration, and only_natural_generation.
  • Dynamic Hot-Reloading: Automatically reloads configuration from disk during world load and datapack sync (/reload), instantly synchronizing the new rule set to clients without restarting Minecraft.
  • Safe Fallback: Any malformed or non-boolean values log an explicit warning and fall back to default (false) cleanly without crashing.

4. Zero Performance Overhead

  • When onlySwapNaturalGeneration is false, the check short-circuits at a single cached boolean read. Thread-local trackers are never accessed, ensuring identical performance to baseline releases.

Testing & Verification

  • NeoForge GameTests: 16 of 16 tests passed.
    • Added testPlayerPlaceAtGraniteNotSwapped in BlockSwapGameTests.java verifying survival player placement with an item in hand.
    • Verified piston pushing, falling sand, fluid updates, stair orientation, log axes, and dynamic config toggling.
  • JUnit 5 Unit Tests: 15 of 15 tests passed in BlockSwapUnitTest.java verifying config parsing, string booleans, aliases, serialization, circular reference protection, and state remapping.
  • Server Verification: Dedicated server smoke test confirmed error-free startup with clean registry and mixin initialization.

This mod has no additional files