Skip to content

Calculate painting offsets in 1.19->1.18.2 - #1313

Open
roccodev wants to merge 2 commits into
ViaVersion:masterfrom
roccodev:feature/painting-offsets
Open

Calculate painting offsets in 1.19->1.18.2#1313
roccodev wants to merge 2 commits into
ViaVersion:masterfrom
roccodev:feature/painting-offsets

Conversation

@roccodev

@roccodev roccodev commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

In 1.19, paintings are no longer referred to in the protocol using their entity coordinates, the block coordinates are used instead. This PR calculates the entity coordinates exactly, replacing the old approximations.

This is required for ViaVersion/ViaRewind#724, which fixes an issue with paintings in 1.8.

For the hardcoded dimensions map, was I right to only use the 1.18 paintings? I couldn't tell whether the paintings were already mapped, because 1.19 added some too. I have the sizes for the 1.19 paintings too if needed.

References:

@kennytv

kennytv commented Sep 4, 2026

Copy link
Copy Markdown
Member

I believe this needs to check for the new type ids, too

@roccodev
roccodev force-pushed the feature/painting-offsets branch from 106c1df to a11e00f Compare September 4, 2026 19:13
@roccodev

roccodev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Yeah that's right, I checked with the Kong painting whose id was changed in 1.19, and it is using the 1.19 ids. I also realised that painting doesn't map properly to 1.8, it gets changed to something else somewhere in the chain, despite it also being a 1.8 painting. I'll try to figure that out next

@roccodev

roccodev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Okay so, it turns out the 1.19 painting IDs weren't mapped at all, I chose some with the same size based on similarity (see https://minecraft.wiki/w/Painting#Unused_paintings), and fixed the Kong mapping.

I also fixed an oversight in the 1.13 name remapping, now if that function gets an unknown ID it correctly returns the Kebab name. In 1.8 for example, the name has to match exactly so that would always appear as a random painting, changing every time.

@roccodev

roccodev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

While I'm here, I found another issue with the 'Albanian' (alban) painting, but I'm not sure who to blame/where to fix.

Basically, the painting works fine when placed, but as soon as the entity is retracked, it's not spawned in older clients. Running Paper 26.2.

The issue here is that alban is the default variant in 26.2 (you can see in the source and also when running /summon minecraft:painting ~ ~ ~ with no tag). It's not even the first in the registry (kebab is, and I believe it's a deliberate choice given that the entries following it are ordered alphabetically), but I think it gets picked because it's first alphabetically in the json definitions. But because both server and client agree, the entity data isn't changed so it never sends it to the client.

Though it's weird that it just doesn't spawn on older clients instead of using another variant, maybe it's being held somewhere in VB that doesn't account for this? I'd imagine somewhere in 1.21-1.20.5 edit: yeah, I guess the 1.19->1.18 handler waits for the data to send add_painting

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