-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
fix: Usage of TextContent::Translate resulted in a bad packet #455
base: master
Are you sure you want to change the base?
fix: Usage of TextContent::Translate resulted in a bad packet #455
Conversation
The usage of TextContent::Translate resulted in a bad package. This was due to the implementation causing the TextComponent's from the with vector to be serialized into a byte array. I would guess, that for the same reason the temporary struct was used.
Feel free to review, but still a draft because there are still two things open:
|
Really impressive for someone who just Started with Rust 👍. Your approche is similar to valence (which is not a bad thing). One thing you have to fix is the CI, In particulier some clippy checks are failing, make sure to fix every warning produced when running Overall good work, Thank you @jonasborsch |
Thanks for the feedback! If I knew there was already an implementation of that I could've saved couple hours of my time. 🥲 Anyway, I'll work on the fixes and then mark the PR as ready for review |
TextComponentNbt * simplified name to Text * convert to inline struct * implement From<TextComponent> trait for conventient use Also added console output to say command. For that the translations also had to be evaluated on the server. The official minecraft server does that using the en_us language. I copied the language file into the assets/lang folder
Had to add the There is still some work left:
|
All files in the assets are coming from our Extractor. Can you may modify the extractor so it produces the latest en-US.json |
That‘s definitely more convenient. I will work on it in the next couple of days. Thanks for the tip |
|
Description
As a heads up, I've never developed in rust before, so please give me the hardest feedback you can.
The usage of
TextContent::Translate
resulted in a bad packet. This was due to the implementation causing theTextComponent
's from thewith
vector to be serialized into a byte array. I would guess, that for the same reason the temporary struct was used.I tried different solutions but the only viable for me seemed to be a wrapper. With that the whole temporary struct could be removed. The
TextComponent
now handles JSON-serialization and theTextComponentNbt
is the NBT binary representation.Testing
Now we can edit the
assets/synced_registries.json
file and we see that the/say
command uses the correct translation.