Skip to content

Root Cause Analysis #1463

Description

@mornfire

Description

Sable's LevelAccelerator.getBlockState() is called during getCollisionShape() of Twilight Forest's ForceFieldBlock. The ForceFieldBlock.getShape() method queries neighboring blocks to determine its visual shape. This query triggers Sable's physics pipeline again, which recursively calls getCollisionShape() again, creating an infinite loop.

The call chain:

  1. Sable handles block change event
  2. Sable calls RapierVoxelColliderBakery.buildPhysicsDataForBlock()
  3. buildPhysicsDataForBlock() calls BlockStateBase.getCollisionShape()
  4. Twilight Forest's ForceFieldBlock.getShape() is executed
  5. ForceFieldBlock calls Level.getBlockState() on neighboring positions
  6. Sable's mixin intercepts this and triggers the physics pipeline again
  7. Go back to step 2 → Recursive update

How to Reproduce

  1. Install Sable 1.2.2 + Twilight Forest 4.8.3345 on NeoForge 1.21.1
  2. Generate a world with Twilight Forest dimension
  3. Load a chunk containing a force field block (found in Aurora Palace structures)
  4. Server crashes during chunk loading

Expected Behavior

Sable should ignore or skip physics processing for Twilight Forest's force field blocks, or handle them without recursively querying block states during collision shape building.

Suggested Fix

Add Twilight Forest's force field blocks to Sable's internal block blacklist, or modify RapierVoxelColliderBakery to cache/cancel recursive calls when the same block state is being processed.

Affected block IDs:

  • twilightforest:force_field
  • twilightforest:force_field_pink
  • twilightforest:force_field_orange
  • twilightforest:force_field_green
  • twilightforest:force_field_blue
  • twilightforest:force_field_violet
  • twilightforest:force_field_yellow
  • twilightforest:force_field_red

Workaround

Temporarily remove Sable from the mods folder, or manually disable Twilight Forest force field generation (not recommended as it breaks Aurora Palace structures).

Additional Context

  • Full crash report:
    at TRANSFORMER/twilightforest@4.8.3345/twilightforest.block.ForceFieldBlock.fullFaceOrSimilarForceField(ForceFieldBlock.java:69)
    at TRANSFORMER/twilightforest@4.8.3345/twilightforest.block.ForceFieldBlock.cornerConnects(ForceFieldBlock.java:64)
    at TRANSFORMER/twilightforest@4.8.3345/twilightforest.block.ForceFieldBlock.getShape(ForceFieldBlock.java:99)
    at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.getShape(BlockBehaviour.java:650)
    at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.getCollisionShape(BlockBehaviour.java:658)
  • This may affect other mods that query block states inside getCollisionShape() or getShape(), not just Twilight Forest.

Game Log

https://mclo.gs/LN83lGY

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions