Skip to content

HangingEntity attachment position shifts during assembly #1557

Description

@Luke100000

Description

I think SubLevelAssemblyHelper.moveOtherStuff() is moving hanging entities using the wrong position:

entity.setPos(transform.apply(entity.position())) Source

For HangingEntity, entity.position() is the center of its bounding box, not necessarily its attachment block. BlockAttachedEntity.setPos(...) then converts that position back into an attachment BlockPos.

This is important for paintings because vanilla applies a 0.5 block offset for even dimensions in Painting.calculateBoundingBox() That offset can thus turn into a one-block attachment shift during assembly. I can reproduce this like this

Image

This matches the behavior reported in Immersive Paintings #139 where odd-sized paintings work, while some even-sized paintings shift (and later break). Immersive Paintings uses the same offset logic in its ImmersivePaintingEntity.

A possible fix would be to transform the hanging entity's attachment position (getPos()) instead of entity.position(). Now, I might be completely wrong here but I'm running out of ideas.

Related Immersive Paintings PR #151

Game Log

https://mclo.gs/z5r8eLe

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions