Skip to content

Commit

Permalink
Don't truncate text on arena signs.
Browse files Browse the repository at this point in the history
Turns out this isn't necessary at all. I think the server used to throw
an exception if there were too many characters on a sign, but it doesn't
seem to be the case anymore (tested on 1.21 and 1.13.2).

This commit simply removes the truncation logic from the sign rendering
procedure, and it fixes issues where text that would otherwise fit on a
sign would be cut off, but more specifically one where color codes would
sort of "push" characters out of the sign despite not being visible.

Fixes #790
  • Loading branch information
garbagemule committed Aug 18, 2024
1 parent c5802fa commit 110076f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ These changes will (most likely) be included in the next version.
- MobArena no longer throws errors when handling block explosions on Minecraft 1.21.
- The `shuffle-positions` ability now correctly shuffles the position of the boss as well if `monster-teleport` is set to `false`.
- The `obsidian-bomb` ability no longer breaks boss waves.
- Text on Arena Signs is no longer explicitly truncated. This fixes an issue where color codes would count towards the character limit, causing the text that would otherwise fit on the sign to be cut off.

## [0.108] - 2024-01-01
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ String[] render(Template template, Arena arena) {

String[] result = new String[lines.length];
for (int i = 0; i < lines.length; i++) {
String rendered = render(lines[i], arena);
result[i] = truncate(rendered);
result[i] = render(lines[i], arena);
}
return result;
}
Expand Down Expand Up @@ -129,11 +128,4 @@ private Collection<Player> getPlayerList(String name, Arena arena) {
}
}

private String truncate(String rendered) {
if (rendered.length() <= 15) {
return rendered;
}
return rendered.substring(0, 15);
}

}

0 comments on commit 110076f

Please sign in to comment.