Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MiniMessage virt components break older component layout equality #1163

Closed
lynxplay opened this issue Feb 15, 2025 · 0 comments · Fixed by #1164
Closed

MiniMessage virt components break older component layout equality #1163

lynxplay opened this issue Feb 15, 2025 · 0 comments · Fixed by #1164

Comments

@lynxplay
Copy link
Contributor

Due to the way virtual components function (as the parent to the "extra data attached" components), virtual components break component layouts between 4.17 and 4.18 minimessage.
The example string <b><gradient:#E0721F:#f2d815:#D43232>A is emitted in the following components

4.17

{
    "bold": true,
    "color": "#E0721F",
    "text": "A"
}

4.18

{
    "bold": true,
    "extra": [
        {
            "color": "#E0721F",
            "text": "A"
        }
    ],
    "text": ""
}

The change is rather damaging as components are part of ItemStack equality checks, preventing e.g. stacking with stacks created under adventure 4.17.

Possible solutions

Either some very clever way to compact virtual components away in some code bit, however that would require extra overhead for every component, making it a bit less than ideal.
Expose a mini message configuration bit somewhere to simply not emit these. While they are certainly useful, most usecases on the platform end will not benefit from them as components are regularly converted/recreated.

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

Successfully merging a pull request may close this issue.

2 participants