mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 02:01:44 +01:00
Cap Objective Score Length
Adds a check for Score arguments that would crash the client
This commit is contained in:
parent
6e842759cc
commit
100c3f07e9
1 changed files with 1 additions and 0 deletions
|
@ -110,6 +110,7 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
||||||
|
|
||||||
public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException {
|
public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException {
|
||||||
Validate.notNull(entry, "Entry cannot be null");
|
Validate.notNull(entry, "Entry cannot be null");
|
||||||
|
Validate.isTrue(entry.length() <= 40, "Score '" + entry + "' is longer than the limit of 40 characters");
|
||||||
CraftScoreboard scoreboard = checkState();
|
CraftScoreboard scoreboard = checkState();
|
||||||
|
|
||||||
return new CraftScore(this, entry);
|
return new CraftScore(this, entry);
|
||||||
|
|
Loading…
Reference in a new issue