Class ObjectiveMock
java.lang.Object
be.seeseemelk.mockbukkit.scoreboard.ObjectiveMock
- All Implemented Interfaces:
org.bukkit.scoreboard.Objective
Mock implementation of an
Objective.-
Constructor Summary
ConstructorsConstructorDescriptionObjectiveMock(@NotNull ScoreboardMock scoreboard, @NotNull String name, @Nullable net.kyori.adventure.text.Component displayName, @NotNull org.bukkit.scoreboard.Criteria criteria, @NotNull org.bukkit.scoreboard.RenderType renderType) Constructs a newObjectiveMockwith the provided parameters. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.ComponentvoiddisplayName(@Nullable net.kyori.adventure.text.Component displayName) @NotNull String@NotNull StringDeprecated.org.bukkit.scoreboard.DisplaySlot@NotNull StringgetName()@NotNull org.bukkit.scoreboard.RenderType@NotNull ScoreMock@NotNull ScoreMockgetScore(@NotNull org.bukkit.OfflinePlayer player) Deprecated.@NotNull org.bukkit.scoreboard.ScoregetScoreFor(@NotNull org.bukkit.entity.Entity entity) @NotNull org.bukkit.scoreboard.CriteriabooleanbooleanChecks if the objective is still registered.@Nullable io.papermc.paper.scoreboard.numbers.NumberFormatvoidnumberFormat(@Nullable io.papermc.paper.scoreboard.numbers.NumberFormat numberFormat) voidsetAutoUpdateDisplay(boolean autoUpdateDisplay) voidsetDisplayName(@NotNull String displayName) Deprecated.voidsetDisplaySlot(@Nullable org.bukkit.scoreboard.DisplaySlot slot) voidsetRenderType(@NotNull org.bukkit.scoreboard.RenderType renderType) voidboolean
-
Constructor Details
-
ObjectiveMock
public ObjectiveMock(@NotNull @NotNull ScoreboardMock scoreboard, @NotNull @NotNull String name, @Nullable @Nullable net.kyori.adventure.text.Component displayName, @NotNull @NotNull org.bukkit.scoreboard.Criteria criteria, @NotNull @NotNull org.bukkit.scoreboard.RenderType renderType) Constructs a newObjectiveMockwith the provided parameters.- Parameters:
scoreboard- The scoreboard this objective is part of.name- The name of the objective.displayName- The display name of the objective.criteria- The criteria of the objective.renderType- The render type of the objective.
-
-
Method Details
-
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 displayName) throws IllegalStateException, IllegalArgumentException - Specified by:
displayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateExceptionIllegalArgumentException
-
getDisplayName
@Deprecated(since="1.16") @NotNull public @NotNull String getDisplayName() throws IllegalStateExceptionDeprecated.- Specified by:
getDisplayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
setDisplayName
@Deprecated(since="1.16") public void setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException Deprecated.- Specified by:
setDisplayNamein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateExceptionIllegalArgumentException
-
getCriteria
- Specified by:
getCriteriain interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getTrackedCriteria
@NotNull public @NotNull org.bukkit.scoreboard.Criteria getTrackedCriteria() throws IllegalStateException- Specified by:
getTrackedCriteriain interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getScoreboard
- Specified by:
getScoreboardin interfaceorg.bukkit.scoreboard.Objective
-
unregister
- Specified by:
unregisterin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
isRegistered
public boolean isRegistered()Checks if the objective is still registered.- Returns:
trueif the objective is still registered,falseif it has been unregistered.
-
setDisplaySlot
public void setDisplaySlot(@Nullable @Nullable org.bukkit.scoreboard.DisplaySlot slot) throws IllegalStateException - Specified by:
setDisplaySlotin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getDisplaySlot
- Specified by:
getDisplaySlotin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
setRenderType
public void setRenderType(@NotNull @NotNull org.bukkit.scoreboard.RenderType renderType) throws IllegalStateException - Specified by:
setRenderTypein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getRenderType
@NotNull public @NotNull org.bukkit.scoreboard.RenderType getRenderType() throws IllegalStateException- Specified by:
getRenderTypein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-
getScore
@Deprecated(since="1.7.10") @NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull org.bukkit.OfflinePlayer player) throws IllegalArgumentException, IllegalStateException Deprecated.- Specified by:
getScorein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalArgumentExceptionIllegalStateException
-
getScore
@NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull String entry) throws IllegalArgumentException, IllegalStateException - Specified by:
getScorein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalArgumentExceptionIllegalStateException
-
getScoreFor
@NotNull public @NotNull org.bukkit.scoreboard.Score getScoreFor(@NotNull @NotNull org.bukkit.entity.Entity entity) throws IllegalArgumentException, IllegalStateException - Specified by:
getScoreForin interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalArgumentExceptionIllegalStateException
-
willAutoUpdateDisplay
public boolean willAutoUpdateDisplay()- Specified by:
willAutoUpdateDisplayin interfaceorg.bukkit.scoreboard.Objective
-
setAutoUpdateDisplay
public void setAutoUpdateDisplay(boolean autoUpdateDisplay) - Specified by:
setAutoUpdateDisplayin interfaceorg.bukkit.scoreboard.Objective
-
numberFormat
@Nullable public @Nullable io.papermc.paper.scoreboard.numbers.NumberFormat numberFormat()- Specified by:
numberFormatin interfaceorg.bukkit.scoreboard.Objective
-
numberFormat
public void numberFormat(@Nullable @Nullable io.papermc.paper.scoreboard.numbers.NumberFormat numberFormat) - Specified by:
numberFormatin interfaceorg.bukkit.scoreboard.Objective
-
isModifiable
- Specified by:
isModifiablein interfaceorg.bukkit.scoreboard.Objective- Throws:
IllegalStateException
-