Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.

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

Fix Implementation
the offset is now specific to the painting.
For the painting, it is now set to
0.5f+1.0f/32.0finstead of0.5f+1.0f/16.0fthe new formula is only applied if the type of the item is
eTYPE_PAINTINGModifying 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.0fAI Use Disclosure
no ai was used
Related Issues