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.Component
void
displayName
(@Nullable net.kyori.adventure.text.Component component) org.bukkit.scoreboard.DisplaySlot
getName()
@NotNull org.bukkit.scoreboard.RenderType
org.bukkit.scoreboard.Score
Returns a score, creating it if necessary.org.bukkit.scoreboard.Score
getScore
(org.bukkit.OfflinePlayer player) Deprecated.org.bukkit.scoreboard.RenderType
getType()
boolean
Returns whether a score is defined.boolean
void
setDisplayName
(String displayName) Sets the display name.void
setDisplaySlot
(org.bukkit.scoreboard.DisplaySlot slot) Sets theDisplaySlot
where this objective displays.void
setRenderType
(@NotNull org.bukkit.scoreboard.RenderType renderType) void
setRenderType
(String renderType) void
setType
(org.bukkit.scoreboard.RenderType renderType) Sets theRenderType
for this objective.void
Removes 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:
unregister
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
- if this objective already isn't registered with a scoreboard
-
getName
- Specified by:
getName
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName() throws IllegalStateException- Specified by:
displayName
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component component) throws IllegalStateException, IllegalArgumentException - Specified by:
displayName
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
IllegalArgumentException
-
getCriteria
- Specified by:
getCriteria
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
getDisplayName
- Specified by:
getDisplayName
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
setDisplayName
public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException Sets the display name.- Specified by:
setDisplayName
in interfaceorg.bukkit.scoreboard.Objective
- Parameters:
displayName
- the new display name, up to 32 characters long- Throws:
IllegalArgumentException
- ifdisplayName
is null or longer than 32 charactersIllegalStateException
- if this objective isn't registered with a scoreboard
-
getDisplaySlot
- Specified by:
getDisplaySlot
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
getRenderType
- Specified by:
getRenderType
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
setRenderType
public void setRenderType(@NotNull org.bukkit.scoreboard.RenderType renderType) throws IllegalStateException - Specified by:
setRenderType
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalStateException
-
setRenderType
-
setDisplaySlot
Sets theDisplaySlot
where this objective displays.- Specified by:
setDisplaySlot
in 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 theRenderType
for this objective.- Parameters:
renderType
- the new render type- Throws:
IllegalArgumentException
- ifrenderType
is nullIllegalStateException
- if this objective isn't registered with a scoreboard
-
isModifiable
- Specified by:
isModifiable
in 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:
getScore
in interfaceorg.bukkit.scoreboard.Objective
- Parameters:
entry
- the key (e.g. player name or team name)- Returns:
- the score for
entry
- Throws:
IllegalArgumentException
- ifentry
is 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:
getScore
in interfaceorg.bukkit.scoreboard.Objective
- Throws:
IllegalArgumentException
IllegalStateException
-
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
- ifentry
is nullIllegalStateException
- if this objective isn't registered with a scoreboard
-
getEntries
- Throws:
IllegalStateException
-
getScoreboard
- Specified by:
getScoreboard
in interfaceorg.bukkit.scoreboard.Objective
-