Skip to content

[Create Compatibility] Chisels & Bits blocks on contraptions crash server with null CenterOfMass in MassTracker #906

@yankeevader

Description

@yankeevader

Context

Crash: Chisels & Bits blocks on Create contraptions cause Sable physics crash

Environment

  • Minecraft: 1.21.1
  • NeoForge
  • Create: 6.0.10
  • Sable: 1.4.6
  • Chisels & Bits: 21.1.32

Originally encountered on a dedicated server and later reproduced in a singleplayer test environment.


Summary

Create contraptions containing Chisels & Bits blocks crash the server during contraption initialization/ticking when Sable physics compatibility is enabled.

The crash occurs while Sable attempts to build mass properties for the contraption.

MassTracker.getCenterOfMass() returns null, and the compatibility layer attempts to call .negate() on the result, causing a hard crash.


Crash Exception

java.lang.NullPointerException: Cannot invoke "org.joml.Vector3dc.negate(org.joml.Vector3d)" because the return value of "dev.ryanhcode.sable.api.physics.mass.MassTracker.getCenterOfMass()" is null

Crash Location

com.simibubi.create.content.contraptions.AbstractContraptionEntity.sable$buildProperties(AbstractContraptionEntity.java:1661)

Reproduction Steps

  1. Install:

    • Create
    • Sable
    • Chisels & Bits
  2. Create a contraption containing one or more Chisels & Bits blocks

  3. Assemble or activate the contraption

  4. Server crashes immediately during contraption tick


Important Observations

  • Removing the Chisels & Bits blocks from the contraption completely stops the crash
  • Removing the contraption entity resolves the crash loop
  • Normal Create contraptions without Chisels & Bits blocks appear to function normally

This strongly suggests the issue is related to Sable mass/property generation for Chisels & Bits multipart geometry within Create contraptions.


Temporary Recovery Command

/kill @e[type=create:stationary_contraption]

Affected Entity

Entity Type: create:stationary_contraption

Crash coordinates from reproduced test:

-46, -58, 50

Stack Trace Snippet

java.lang.NullPointerException: Cannot invoke "org.joml.Vector3dc.negate(org.joml.Vector3d)" because the return value of "dev.ryanhcode.sable.api.physics.mass.MassTracker.getCenterOfMass()" is null
	at com.simibubi.create.content.contraptions.AbstractContraptionEntity.sable$buildProperties(AbstractContraptionEntity.java:1661)
	at com.simibubi.create.content.contraptions.AbstractContraptionEntity.handler$hne000$sable$contraptionInitialize(AbstractContraptionEntity.java:1594)
	at com.simibubi.create.content.contraptions.AbstractContraptionEntity.tick(AbstractContraptionEntity.java:374)

Possible Cause

Potentially related to one of the following:

  • invalid/empty voxel mass data
  • unsupported multipart/chiseled geometry
  • zero-mass contraption edge case
  • missing null handling for center-of-mass generation in the Sable Create compatibility layer

Additional Notes

The crash appears to originate specifically from the Sable/Create compatibility integration rather than vanilla Create itself.

Once the Chisels & Bits blocks are removed from the contraption, the crash no longer occurs.
-- /tick freeze - command nuke the contraption -- restart server -- good to go

Crash Report

https://mclo.gs/BpPQZi7

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