Skip to content

Server Crash (NPE) when placing blocks on a Contraption at a Train Station #457

@Cha-Shao

Description

@Cha-Shao

Context

Image

Description

A java.lang.NullPointerException occurs when interacting with a Create contraption (specifically by placing a torch or updating blocks) while using the Sable physics mod. The crash is triggered during the entity ticking process.

Technical Details

  • Minecraft Version: 1.21.1
  • NeoForge Version: 21.1.227
  • Sable Version: 1.1.3
  • Create Version: 6.0.10
  • Error Type: java.lang.NullPointerException
  • Error Message: Cannot invoke "org.joml.Vector3dc.negate(org.joml.Vector3d)" because the return value of "dev.ryanhcode.sable.api.physics.mass.MassTracker.getCenterOfMass()" is null

Steps to Reproduce

  1. Set up a Create Train Station and assemble a train/contraption.
  2. Place a Torch (or any block that updates the contraption structure) on the assembled contraption.
  3. The server immediately crashes when the AbstractContraptionEntity attempts to tick and update its physical properties via Sable's Mixin.

Analysis

The crash occurs in com.simibubi.create.content.contraptions.AbstractContraptionEntity.sable$buildProperties. Sable's mass tracking system fails to return a valid center of mass (getCenterOfMass() returns null), causing the physics calculation to fail when it attempts to negate that vector.

Environment

  • OS: Linux (amd64) version 6.1.0-44-amd64
  • Java: 21.0.10 (Eclipse Adoptium)
  • Affected Entity: minecraft:minecart (Entity ID: 7) carrying an OrientedContraptionEntity

Crash Report

https://mclo.gs/0RXjAHK

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