Skip to content

ArrayIndexOutOfBoundsException in VoxelNeighborhoodState when DirtPathBlock ticks (Index -1) #1292

Description

@littlhMW

Context

Description

When creating a new world or loading an existing one in a heavily modded NeoForge 1.21.1 environment, the server thread crashes shortly after entering the world. The crash occurs during the ticking of a Dirt Path block (which tries to revert to dirt) and seems to be triggered by Sable's physics engine.

The stack trace points to VoxelNeighborhoodState.getState() and an Int2BooleanOpenHashMap.computeIfAbsent() call with an index of -1, causing an ArrayIndexOutOfBoundsException.

Steps to Reproduce

  1. Install the mod list provided in the attached latest.log (key mods include Sable 2.0.3, Create 6.0.10, YUNG's Better Caves 3.1.4, C2ME 0.4.0, etc.).
  2. Create a new world or load an existing one.
  3. Wait a few seconds for world ticks to occur. The crash happens when a Dirt Path block (e.g., from a path block) ticks and attempts to revert to dirt.
  4. Server thread crashes immediately.

Expected Behavior

The world should continue ticking normally without crashing.

Actual Behavior

Game crashes with java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 33 originating from Sable's physics code.

Relevant Stack Trace (Full crash report attached)

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 33
at it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap.rehash(Int2BooleanOpenHashMap.java:1335)
at it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap.insert(Int2BooleanOpenHashMap.java:257)
at it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap.computeIfAbsent(Int2BooleanOpenHashMap.java:456)
at dev.ryanhcode.sable.physics.chunk.VoxelNeighborhoodState$1.apply(VoxelNeighborhoodState.java:31)
...
at net.minecraft.world.level.block.DirtPathBlock.tick(DirtPathBlock.java:56)
at net.minecraft.world.level.block.FarmBlock.turnToDirt(FarmBlock.java:112)
...
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:917)

Environment

  • Minecraft Version: 1.21.1
  • NeoForge Version: 21.1.233
  • Sable Version: 2.0.3 (from sable-neoforge-1.21.1-2.0.3.jar)
  • Other notable mods: Create 6.0.10, YUNG's Better Caves 3.1.4, C2ME 0.4.0, Lithium 0.15.4, etc. (full list in attached log)
  • Java: Microsoft OpenJDK 21.0.7
  • OS: Windows 11

Additional Notes

  • The crash appears to be triggered by a block state change (DirtPath → Dirt) handled by Sable's SableCommonEvents.handleBlockChange.
  • There are also repeated warnings from Better Caves about AquiferContext is null, but the crash trace is solely inside Sable.
  • I can reproduce this reliably. Disabling Sable prevents the crash.

Crash Report

https://mclo.gs/eM5sop9

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: crashSomething crashes my game

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions