diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/Objective.java b/paper-api/src/main/java/org/bukkit/scoreboard/Objective.java index 1802d1db2a..cc3a3e04db 100644 --- a/paper-api/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/paper-api/src/main/java/org/bukkit/scoreboard/Objective.java @@ -85,6 +85,22 @@ public interface Objective { */ DisplaySlot getDisplaySlot() throws IllegalStateException; + /** + * Sets manner in which this objective will be rendered. + * + * @param renderType new render type + * @throws IllegalStateException if this objective has been unregistered + */ + void setRenderType(RenderType renderType) throws IllegalStateException; + + /** + * Sets manner in which this objective will be rendered. + * + * @return the render type + * @throws IllegalStateException if this objective has been unregistered + */ + RenderType getRenderType() throws IllegalStateException; + /** * Gets a player's Score for an Objective on this Scoreboard * diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/RenderType.java b/paper-api/src/main/java/org/bukkit/scoreboard/RenderType.java new file mode 100644 index 0000000000..df267ccec9 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/scoreboard/RenderType.java @@ -0,0 +1,19 @@ +package org.bukkit.scoreboard; + +/** + * Controls the way in which an {@link Objective} is rendered client side. + * + * @deprecated draft API + */ +@Deprecated +public enum RenderType { + + /** + * Display integer value. + */ + INTEGER, + /** + * Display number of hearts corresponding to value. + */ + HEARTS; +} diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/paper-api/src/main/java/org/bukkit/scoreboard/Scoreboard.java index 40f36b47a1..85471b3f9b 100644 --- a/paper-api/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/paper-api/src/main/java/org/bukkit/scoreboard/Scoreboard.java @@ -45,6 +45,27 @@ public interface Scoreboard { */ Objective registerNewObjective(String name, String criteria, String displayName) throws IllegalArgumentException; + /** + * Registers an Objective on this Scoreboard + * + * @param name Name of the Objective + * @param criteria Criteria for the Objective + * @param displayName Name displayed to players for the Objective. + * @param renderType Manner of rendering the Objective + * @return The registered Objective + * @throws IllegalArgumentException if name is null + * @throws IllegalArgumentException if name is longer than 16 + * characters. + * @throws IllegalArgumentException if criteria is null + * @throws IllegalArgumentException if displayName is null + * @throws IllegalArgumentException if displayName is longer than 128 + * characters. + * @throws IllegalArgumentException if renderType is null + * @throws IllegalArgumentException if an objective by that name already + * exists + */ + Objective registerNewObjective(String name, String criteria, String displayName, RenderType renderType) throws IllegalArgumentException; + /** * Gets an Objective on this Scoreboard by name *