Don't truncate text on arena signs.
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
This commit is contained in:
@@ -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.
|
- 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 `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.
|
- 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
|
## [0.108] - 2024-01-01
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ class RendersTemplate {
|
|||||||
|
|
||||||
String[] result = new String[lines.length];
|
String[] result = new String[lines.length];
|
||||||
for (int i = 0; i < lines.length; i++) {
|
for (int i = 0; i < lines.length; i++) {
|
||||||
String rendered = render(lines[i], arena);
|
result[i] = render(lines[i], arena);
|
||||||
result[i] = truncate(rendered);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -129,11 +128,4 @@ class RendersTemplate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String truncate(String rendered) {
|
|
||||||
if (rendered.length() <= 15) {
|
|
||||||
return rendered;
|
|
||||||
}
|
|
||||||
return rendered.substring(0, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user