Sponge
Sponge copied to clipboard
ArchetypeVolumes place certain paintings incorrectly
I am currently running
spongeforge-1.12.2-2838-7.1.7-RC3924
Issue Description Painting entities use a BlockPos for their hanging position which is different to the entity's position coords (posX, posY, posZ) - these vary depending on the width/height of the painting & can be over a full block's distance away from the hanging position.
The ArchetypeVolume implementation doesn't consider this and only uses the entity position (posX, posY, posZ) to place the painting rather than it's hanging position. This can result in paintings being placed up to a couple of blocks out of position.
I believe the fix would be to check-for and return the TileX, TileY, TileZ coords for the position, falling back to the regular position data for all other entities: https://github.com/SpongePowered/SpongeCommon/blob/stable-7/src/main/java/org/spongepowered/common/entity/SpongeEntityArchetype.java#L82
Also, the TileX/Y/Z coords won't have been relativized during creation which is an issue for the suggested fix.
Finally I've noticed that some fields in the entity data are removed during the apply() method. If it were serialized after use then the nbt would be missing the "Pos" entry (for example). https://github.com/SpongePowered/SpongeCommon/blob/stable-7/src/main/java/org/spongepowered/common/entity/SpongeEntityArchetype.java#L142