Reduce compact wool scoreboard component length #1084
Merged
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.
The recent changes migrating the scoreboard to use components has an unintended side effect of increasing the character count of the lines due to the use of
space()
. When these components are translated back to legacy format the extra spaces add unnecessary resets to the string. This causes the line to be sliced in order to be compact enough for scoreboard display causing wools to be cut off where they had previously not.An example of this is below.
§1⬜§r §3⬜§r §2⬜§r §a⬜§r §6⬜§r §e⬜
Each set of spaces causes the
§r
characters to be added after each wool which increases its final display length.This change appends the spaces in a way that does not require the resets and produces the below.
§1 ⬜§2 ⬜§6 ⬜§c ⬜§5 ⬜§4 ⬜§7 ⬜
which is 10 characters shorter.Examples of compact scoreboards with many wools.
This commit also removes an extra space that was added at the start of the wool line which caused it to start with two spaces rather than the previous one. Looking back at the commits prior to this change and old OCN videos one space seems to be correct.
If there's a better way to do this let me know.