diff --git a/src/main/java/org/spongepowered/api/scoreboard/Score.java b/src/main/java/org/spongepowered/api/scoreboard/Score.java index b95d2c8569..5aa9101839 100644 --- a/src/main/java/org/spongepowered/api/scoreboard/Score.java +++ b/src/main/java/org/spongepowered/api/scoreboard/Score.java @@ -25,8 +25,10 @@ package org.spongepowered.api.scoreboard; import net.kyori.adventure.text.Component; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.scoreboard.objective.Objective; +import java.util.Optional; import java.util.Set; /** @@ -39,7 +41,7 @@ public interface Score { * * @return The name of this score */ - Component name(); + String name(); /** * Gets the current score value. @@ -69,6 +71,12 @@ public interface Score { */ void setLocked(boolean locked); + // TODO javadocs + void setDisplay(@Nullable Component display); + Optional display(); + + // TODO numberformat + /** * Returns a {@link Set} of parent {@link Objective}s this {@link Score} is * registered to. diff --git a/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java b/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java index 00cf258dc3..d3a96d2362 100644 --- a/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java +++ b/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java @@ -103,7 +103,7 @@ static Builder builder() { * * @return The set of {@link Score}s for this objective */ - Map scores(); + Map scores(); /** * Returns whether this objective has a {@link Score} with the given name. @@ -111,7 +111,7 @@ static Builder builder() { * @param name The name of the {@link Score} to check for. * @return Whether this objective has a {@link Score} with the given name. */ - boolean hasScore(Component name); + boolean hasScore(String name); /** * Adds the specified {@link Score} to this objective. @@ -121,13 +121,15 @@ static Builder builder() { */ void addScore(Score score) throws IllegalArgumentException; + // TODO findScore for player/entity? + /** * Gets an entry's {@link Score} for this objective, if it exists. * * @param name The name of the {@link Score} to get. * @return The {@link Score} for te specified {@link Component}, if it exists. */ - default Optional findScore(final Component name) { + default Optional findScore(final String name) { if (!this.hasScore(name)) { return Optional.empty(); } @@ -142,7 +144,7 @@ default Optional findScore(final Component name) { * @param name The name of the {@link Score} to get * @return The {@link Score} for the specified {@link Component} */ - Score findOrCreateScore(Component name); + Score findOrCreateScore(String name); /** * Removes the specified {@link Score} from this objective, if present. @@ -158,7 +160,7 @@ default Optional findScore(final Component name) { * @param name The name of the {@link Score} to remove. * @return Whether the score existed on this objective */ - boolean removeScore(Component name); + boolean removeScore(String name); /** * Returns a {@link Set} of parent {@link Scoreboard}s this