geforkt von Mirrors/Paper
SPIGOT-5863: Don't check colour in scoreboard length validation
Dieser Commit ist enthalten in:
Ursprung
f2cbce30d9
Commit
2a8482869d
@ -38,7 +38,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
@Override
|
||||
public void setDisplayName(String displayName) throws IllegalStateException {
|
||||
Validate.notNull(displayName, "Display name cannot be null");
|
||||
Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters");
|
||||
Validate.isTrue(ChatColor.stripColor(displayName).length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
team.setDisplayName(CraftChatMessage.fromString(displayName)[0]); // SPIGOT-4112: not nullable
|
||||
@ -54,7 +54,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
@Override
|
||||
public void setPrefix(String prefix) throws IllegalStateException, IllegalArgumentException {
|
||||
Validate.notNull(prefix, "Prefix cannot be null");
|
||||
Validate.isTrue(prefix.length() <= 64, "Prefix '" + prefix + "' is longer than the limit of 64 characters");
|
||||
Validate.isTrue(ChatColor.stripColor(prefix).length() <= 64, "Prefix '" + prefix + "' is longer than the limit of 64 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
team.setPrefix(CraftChatMessage.fromStringOrNull(prefix));
|
||||
@ -70,7 +70,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
@Override
|
||||
public void setSuffix(String suffix) throws IllegalStateException, IllegalArgumentException {
|
||||
Validate.notNull(suffix, "Suffix cannot be null");
|
||||
Validate.isTrue(suffix.length() <= 64, "Suffix '" + suffix + "' is longer than the limit of 64 characters");
|
||||
Validate.isTrue(ChatColor.stripColor(suffix).length() <= 64, "Suffix '" + suffix + "' is longer than the limit of 64 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
team.setSuffix(CraftChatMessage.fromStringOrNull(suffix));
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren