Open Sergio-Luis20 opened 7 months ago
I marked this as low
priority, because the fix for this is currently pretty ugly as it would require re-creating specific packets for each player instead of using the same packet data for all players it's being sent to. The reason this same problem doesn't apply to other areas, is that the text is "translated" as it's written to the bytebuf, so after the packet has been created. It's very possible mojang will also change block entities to a similar system in the future, and this is more feasible then. You can see where I got to on this branch.
Expected behavior
I expected using Component.translatable(...) would work on Sign blocks. Using server-side translations with GlobalTranslator should show the translated text to the client in a line of a Sign that uses that implementation of Component.
Observed/Actual behavior
In lines that uses TranslatableComponent, it only shows the translation key as text instead of the actual translation from ResourceBundle. I've checked the keys and they're all correct. Styles as color and decorations work well, only the text shown is the problem.
Steps/models to reproduce
Just get a Sign block from a World and try to use Component.translatable(...) to write some of its lines. Update the Sign using the SignSide method.
Here is my code:
MinigameInfo info = minigame.getInfo(); Component[] lines = new Component[4]; lines[0] = Component.text(info.name() + " " + index); switch(state) { case AVAILABLE -> { lines[1] = Component.translatable("minigame.sign.available", NamedTextColor.GREEN); lines[2] = Component.text(minigame.getWorld().getPlayerCount() + "/"
Plugin and Datapack List
Plugins: Datapacks:
Paper version
This server is running Paper version git-Paper-459 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 88419b2) You are 37 version(s) behind Download the new version at: https://papermc.io/downloads/paper
Other
No response