There could be a new component type that indicates that the component has been rendered as server side translatable. Meaning, the itemstack does have a name, but the name is the result of a server side translating process based on the clients locale. If I render two itemnames on server side according to the players locale, the items will not be stackable anymore if they are in two different languages.
Instead, a new component type could only compare the two translatables based on arguments and key, no matter what the actual delivered json contains.
Like
// serverside:
{"translatable": "my.plugin.item", "args": ["some values"]}
// becomes
{"sstranslatable": "my.plugin.item", "args": ["some values"], "render-as": "{text:"this is the rendered item name in locale english, containing >some values<"}"}
So with the current component system as of 1.20.4, only the value of "render-as" is being sent to client, but with only the additional information of key and args, comparison and serverside translation could work without issues.
The alternative from a plugin developers point of view would be to abuse the one translation code in the minecraft vanilla translations that is
"createWorld.customize.flat.layer": "%s"
And in packets from server to client set the args to the serverside rendered component and its args, on packets from client to server with that precise key drop the first arg to make itemstacks stackable again.
Please sign in to leave a comment.
0 Comments