public final class GlowObjective extends Object implements org.bukkit.scoreboard.Objective
Constructor and Description |
---|
GlowObjective(GlowScoreboard scoreboard,
String name,
String criteria)
Creates a scoreboard objective.
|
Modifier and Type | Method and Description |
---|---|
String |
getCriteria() |
String |
getDisplayName() |
org.bukkit.scoreboard.DisplaySlot |
getDisplaySlot() |
Set<String> |
getEntries() |
String |
getName() |
org.bukkit.scoreboard.Score |
getScore(org.bukkit.OfflinePlayer player)
Deprecated.
|
org.bukkit.scoreboard.Score |
getScore(String entry)
Returns a score, creating it if necessary.
|
GlowScoreboard |
getScoreboard() |
RenderType |
getType() |
boolean |
hasScore(String entry)
Returns whether a score is defined.
|
boolean |
isModifiable() |
void |
setDisplayName(String displayName)
Sets the display name.
|
void |
setDisplaySlot(org.bukkit.scoreboard.DisplaySlot slot)
Sets the
DisplaySlot where this objective displays. |
void |
setRenderType(String renderType) |
void |
setType(RenderType renderType)
Sets the
RenderType for this objective. |
void |
unregister()
Removes this objective from the scoreboard.
|
public GlowObjective(GlowScoreboard scoreboard, String name, String criteria)
scoreboard
- the scoreboard to add toname
- the name of the objectivecriteria
- one of the constants from Criterias
, or anything else if this score
is only modified by commands and/or plugins.public void unregister() throws IllegalStateException
unregister
in interface org.bukkit.scoreboard.Objective
IllegalStateException
- if this objective already isn't registered with a scoreboardpublic String getName() throws IllegalStateException
getName
in interface org.bukkit.scoreboard.Objective
IllegalStateException
public String getCriteria() throws IllegalStateException
getCriteria
in interface org.bukkit.scoreboard.Objective
IllegalStateException
public String getDisplayName() throws IllegalStateException
getDisplayName
in interface org.bukkit.scoreboard.Objective
IllegalStateException
public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException
setDisplayName
in interface org.bukkit.scoreboard.Objective
displayName
- the new display name, up to 32 characters longIllegalArgumentException
- if displayName
is null or longer than 32 charactersIllegalStateException
- if this objective isn't registered with a scoreboardpublic org.bukkit.scoreboard.DisplaySlot getDisplaySlot() throws IllegalStateException
getDisplaySlot
in interface org.bukkit.scoreboard.Objective
IllegalStateException
public void setDisplaySlot(org.bukkit.scoreboard.DisplaySlot slot) throws IllegalStateException
DisplaySlot
where this objective displays.setDisplaySlot
in interface org.bukkit.scoreboard.Objective
slot
- the DisplaySlot, or null to hide the objectiveIllegalStateException
- if this objective isn't registered with a scoreboardpublic RenderType getType() throws IllegalStateException
IllegalStateException
public void setType(RenderType renderType) throws IllegalStateException
RenderType
for this objective.renderType
- the new render typeIllegalArgumentException
- if renderType
is nullIllegalStateException
- if this objective isn't registered with a scoreboardpublic boolean isModifiable() throws IllegalStateException
isModifiable
in interface org.bukkit.scoreboard.Objective
IllegalStateException
public org.bukkit.scoreboard.Score getScore(String entry) throws IllegalArgumentException, IllegalStateException
getScore
in interface org.bukkit.scoreboard.Objective
entry
- the key (e.g. player name or team name)entry
IllegalArgumentException
- if entry
is nullIllegalStateException
- if this objective isn't registered with a scoreboard@Deprecated public org.bukkit.scoreboard.Score getScore(org.bukkit.OfflinePlayer player) throws IllegalArgumentException, IllegalStateException
getScore
in interface org.bukkit.scoreboard.Objective
IllegalArgumentException
IllegalStateException
public void setRenderType(String renderType)
public boolean hasScore(String entry) throws IllegalArgumentException, IllegalStateException
entry
- the key (e.g. player name or team name)IllegalArgumentException
- if entry
is nullIllegalStateException
- if this objective isn't registered with a scoreboardpublic Set<String> getEntries() throws IllegalStateException
IllegalStateException
public GlowScoreboard getScoreboard()
getScoreboard
in interface org.bukkit.scoreboard.Objective
Copyright © 2021. All rights reserved.