JSON page deserialization in PrintingPlateJSONRecipe so plates render…#924
Open
mousebites wants to merge 1 commit into
Open
JSON page deserialization in PrintingPlateJSONRecipe so plates render…#924mousebites wants to merge 1 commit into
mousebites wants to merge 1 commit into
Conversation
Author
|
Let me know if there is anything else I can do to help with this, no pressure though if this is low priority! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #923
Fix made and tested before @Ameliorate suggested the more comprehensive re-write. Seems to solve the bug on cases I tested and may be sufficient to fix the plates being completely busted in the interim.
Changed
Converted the text content from books into strings that can be deserialized before the content is added to the
pageComponent.Why
If the data isn't deserialized, the serialized JSON just ends up as plaintext.
Tests
Tested existing behavior vs post-fix on a locally hosted Civ server.
{"text":"X","color":"gold","bold":true}["",{"text":"We"},{"text":"lco","italic":true},{"text":"me t"},{"text":"o Minec","color":"aqua"},{"text":"raft To","bold":true,"color":"aqua"},{"text":"ols","color":"aqua"}]{"text":"Hex ","color":"#55FF55","extra":[{"text":"B","bold":true},{"text":"I","italic":true}{"text":" U","underlined":true},{"text":"S","strikethrough":true},{"text":" O","obfuscated":true}]}["",{"keybind":"key.jump"},{"text":" / "},{"translate":"menu.singleplayer"}]{"text":"hover me","hoverEvent":{"action":"show_text","contents":{"text":"hi","color":"gold"}},"clickEvent":{"action":"suggest_command","value":"/help"}}{"text":"Hello+ page2World"}{"text":"oops"input: {"score":{"name":"@p","objective":"x"}}Banned Tag Errorhello world*Not sure why click events aren't working, didn't investigate. Could be neat to pre-fill chatbox with
/destlocations if it did but also not why I'm here.LLM Disclosure
Used
claude-opus-4-7, verified changes and tested outcomes in client on a locally hosted Civ instance.