Fix scoreboard objective name length limit
This commit is contained in:
@@ -3352,7 +3352,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Validate.notNull(criteria, "Criteria cannot be null");
|
||||
+ Validate.notNull(displayName, "Display name cannot be null");
|
||||
+ Validate.notNull(renderType, "RenderType cannot be null");
|
||||
+ Validate.isTrue(name.length() <= 16, "The name '" + name + "' is longer than the limit of 16 characters");
|
||||
+ Validate.isTrue(name.length() <= Short.MAX_VALUE, "The name '" + name + "' is longer than the limit of 32767 characters");
|
||||
+ Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
|
||||
+ CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);
|
||||
+ net.minecraft.world.scores.Objective objective = board.addObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
||||
|
||||
Reference in New Issue
Block a user