Package net.glowstone.scoreboard
Class GlowObjective
java.lang.Object
net.glowstone.scoreboard.GlowObjective
- All Implemented Interfaces:
org.bukkit.scoreboard.Objective
Scoreboard objective and associated data.
-
Constructor Summary
ConstructorsConstructorDescriptionGlowObjective(GlowScoreboard scoreboard, String name, String criteria) Creates a scoreboard objective. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.ComponentvoiddisplayName(@Nullable net.kyori.adventure.text.Component component) org.bukkit.scoreboard.DisplaySlotgetName()@NotNull org.bukkit.scoreboard.RenderTypeorg.bukkit.scoreboard.ScoreReturns a score, creating it if necessary.org.bukkit.scoreboard.ScoregetScore(org.bukkit.OfflinePlayer player) Deprecated.org.bukkit.scoreboard.RenderTypegetType()booleanReturns whether a score is defined.booleanvoidsetDisplayName(String displayName) Sets the display name.voidsetDisplaySlot(org.bukkit.scoreboard.DisplaySlot slot) Sets theDisplaySlotwhere this objective displays.voidsetRenderType(@NotNull org.bukkit.scoreboard.RenderType renderType) voidsetRenderType(String renderType) voidsetType(org.bukkit.scoreboard.RenderType renderType) Sets theRenderTypefor this objective.voidRemoves this objective from the scoreboard.
-
Constructor Details
-
GlowObjective
Creates a scoreboard objective.- Parameters:
scoreboard- the scoreboard to add toname- the name of the objectivecriteria- one of the constants fromCriterias, or anything else if this score is only modified by commands and/or plugins.
-
-
Method Details
-
unregister
Removes this objective from the scoreboard.- Specified by:
unregisterin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException- if this objective already isn't registered with a scoreboard
-
getName
- Specified by:
getNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName() throws IllegalStateException- Specified by:
displayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component component) throws IllegalStateException, IllegalArgumentException - Specified by:
displayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateExceptionIllegalArgumentException
-
getCriteria
- Specified by:
getCriteriain interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getDisplayName
- Specified by:
getDisplayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
setDisplayName
public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException Sets the display name.- Specified by:
setDisplayNamein interfaceorg.bukkit.scoreboard.Objective- Parameters:
displayName- the new display name, up to 32 characters long- Throws:
IllegalArgumentException- ifdisplayNameis null or longer than 32 charactersIllegalStateException- if this objective isn't registered with a scoreboard
-
getDisplaySlot
- Specified by:
getDisplaySlotin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getRenderType
- Specified by:
getRenderTypein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
setRenderType
public void setRenderType(@NotNull org.bukkit.scoreboard.RenderType renderType) throws IllegalStateException - Specified by:
setRenderTypein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
setRenderType
-
setDisplaySlot
Sets theDisplaySlotwhere this objective displays.- Specified by:
setDisplaySlotin interfaceorg.bukkit.scoreboard.Objective- Parameters:
slot- the DisplaySlot, or null to hide the objective- Throws:
IllegalStateException- if this objective isn't registered with a scoreboard
-
getType
- Throws:
IllegalStateException
-
setType
Sets theRenderTypefor this objective.- Parameters:
renderType- the new render type- Throws:
IllegalArgumentException- ifrenderTypeis nullIllegalStateException- if this objective isn't registered with a scoreboard
-
isModifiable
- Specified by:
isModifiablein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getScore
public org.bukkit.scoreboard.Score getScore(String entry) throws IllegalArgumentException, IllegalStateException Returns a score, creating it if necessary.- Specified by:
getScorein interfaceorg.bukkit.scoreboard.Objective- Parameters:
entry- the key (e.g. player name or team name)- Returns:
- the score for
entry - Throws:
IllegalArgumentException- ifentryis nullIllegalStateException- if this objective isn't registered with a scoreboard
-
getScore
@Deprecated public org.bukkit.scoreboard.Score getScore(org.bukkit.OfflinePlayer player) throws IllegalArgumentException, IllegalStateException Deprecated.- Specified by:
getScorein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalArgumentExceptionIllegalStateException
-
hasScore
Returns whether a score is defined.- Parameters:
entry- the key (e.g. player name or team name)- Returns:
- true if the score exists; false otherwise
- Throws:
IllegalArgumentException- ifentryis nullIllegalStateException- if this objective isn't registered with a scoreboard
-
getEntries
- Throws:
IllegalStateException
-
getScoreboard
- Specified by:
getScoreboardin interfaceorg.bukkit.scoreboard.Objective
-