Skip to content

Fix floating painting#1044

Open
TheLordWolf wants to merge 3 commits intosmartcmd:mainfrom
TheLordWolf:main
Open

Fix floating painting#1044
TheLordWolf wants to merge 3 commits intosmartcmd:mainfrom
TheLordWolf:main

Conversation

@TheLordWolf
Copy link

Description

This PR fixes the floating painting describe in the issue #661

Changes

Previous Behavior

Before, there would be a slight gap between a painting, and the block it is placed on.
before

Root Cause

The position offset variable "fOffs" in the setDir function in Minecraft.World/HangingEntity.cpp would be the same across all children of HangingEntity, it does not cause issue for the item frame and the leashknot (the only other children of HangingEntity), but for the painting the offset is too big and it causes the visual gap.

New Behavior

The previous gap is not visible anymore
after

Fix Implementation

the offset is now specific to the painting.
For the painting, it is now set to 0.5f+1.0f/32.0f instead of 0.5f+1.0f/16.0f
the new formula is only applied if the type of the item is eTYPE_PAINTING

Modifying this value also moves the bounding box of the painting, and it causes an issue where you are able to place a painting on a block where an item frame is already placed on
to fix this issue, the x and z coords are set to the values they currently have, in other words, the x/z coords are recalculated to match the values they would have if fOffs was using its current formula 0.5f+1.0f/16.0f

AI Use Disclosure

no ai was used

Related Issues

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.

[Bug] Floating paintings

1 participant