Skip to content

Fix crash/incorrect block rotation when placing computer case or screen on sideways sable sublevels - #98

Merged
CaitlynMainer merged 1 commit into
PC-Logix:main-MC1.21.1from
getItemFromBlock:main-MC1.21.1
Sep 13, 2026
Merged

Fix crash/incorrect block rotation when placing computer case or screen on sideways sable sublevels#98
CaitlynMainer merged 1 commit into
PC-Logix:main-MC1.21.1from
getItemFromBlock:main-MC1.21.1

Conversation

@getItemFromBlock

Copy link
Copy Markdown

The current code responsible for block placement on sable sublevels does not handle sideways sublevels. This can result in a crash, as the game can try to assign an invalid value to the direction of screens or computer cases.
This small PR fixes that, and also make the value properly checked before trying to assign them.
Instead of trying to rotate the facing direction, the new implementation now rotates the players's forward and side vector, and then try to interpret that as a pitch and yaw. Side vector is used as a failsafe for when the forward vector is aligned with the Y axis.
I did need to add a couple functions to the Sable integration, I made sure to update the code comments accordingly.

If you want me to change anything let me know, Scala isn't a language I usually program with so I might have missed a couple things.

Also no AI was used in any of this

@CaitlynMainer
CaitlynMainer merged commit bc001e4 into PC-Logix:main-MC1.21.1 Sep 13, 2026
1 check 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.

2 participants