Skip to content

Fix ClassCastException in PhysicsAssemblerGUIHandler - #1098

Merged
Ocelot5836 merged 1 commit into
Creators-of-Aeronautics:mainfrom
lap2ka:fix-physicsassembler-crash
May 21, 2026
Merged

Fix ClassCastException in PhysicsAssemblerGUIHandler#1098
Ocelot5836 merged 1 commit into
Creators-of-Aeronautics:mainfrom
lap2ka:fix-physicsassembler-crash

Conversation

@lap2ka

@lap2ka lap2ka commented May 20, 2026

Copy link
Copy Markdown
Contributor

Fix ClassCastException in PhysicsAssemblerGUIHandler when interacting
with the assembler while a ghost block is at its position.

Encountered this bug when testing ryanhcode/sable#966 lol

Steps to reproduce:

  • Grab a creative motor in your hand (could be another block or be, I tested with this one)
  • Rapidly assemble and disassemble the sub-level until the game inevitably crashes with a ClassCastException

… with the assembler while a ghost block is at its position
Copilot AI review requested due to automatic review settings May 20, 2026 01:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a client crash (ClassCastException) in the physics assembler hold interaction by removing an unsafe cast when reading the block entity at the interaction position, which can temporarily be a different/ghost block entity during rapid assemble/disassemble.

Changes:

  • Replaced a direct cast of getBlockEntity(...) to PhysicsAssemblerBlockEntity with an instanceof check to safely handle null/other block entities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ocelot5836
Ocelot5836 merged commit c641757 into Creators-of-Aeronautics:main May 21, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants