Provide a simple way to replace components deeply when using a ComponentRenderer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 887
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
Currently I am using the following code to render out styling and text replacements based on translation keys: https://gist.github.com/octylFractal/cdd92710b05b50613d96d2fee35427f2
However, my main issue is that I have to manually do deep replacement, and this leaves me open to bugs like forgetting that a translatable component can have args and children. It would be nice if adventure allowed me to write a ComponentRenderer that made the call I make at the top of render in the above code: component = replaceSubcomponents(component, context);
In this way, it would automatically deeply render all relevant parts, and as replaceSubcomponents would become part of adventure code, it would be well tested + supported by the library, as well as more likely to include any future sub-component cases.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ComponentRenderer and the replaceSubcomponents call shown in the linked gist; trace how components expose args and children. Done means a renderer can perform the deep replacement without manual traversal, with coverage for those nested parts and future relevant sub-component cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100