From 155b17305b87f11e8e7b7fd247c68c73759cf97f Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 23 Jul 2018 11:46:23 +1000 Subject: SPIGOT-4112: scoreboard display names are not nullable --- src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java | 2 +- src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 3f8f1754..0ef48af0 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/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/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index c511fa88..7f710e36 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/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 { -- cgit v1.2.3