From f4d1912ded3c598485557da01c586d44056d82c6 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 23 Jul 2018 11:46:23 +1000 Subject: [PATCH] SPIGOT-4112: scoreboard display names are not nullable By: md_5 --- .../java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java | 2 +- .../main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 3f8f1754a0..0ef48af0d3 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -42,7 +42,7 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters"); CraftScoreboard scoreboard = checkState(); - objective.setDisplayName(CraftChatMessage.fromStringOrNull(displayName)); + objective.setDisplayName(CraftChatMessage.fromString(displayName)[0]); // SPIGOT-4112: not nullable } public String getCriteria() throws IllegalStateException { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index c511fa8826..7f710e36ba 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -41,7 +41,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters"); CraftScoreboard scoreboard = checkState(); - team.setDisplayName(CraftChatMessage.fromStringOrNull(displayName)); + team.setDisplayName(CraftChatMessage.fromString(displayName)[0]); // SPIGOT-4112: not nullable } public String getPrefix() throws IllegalStateException {