Class ObjectiveMock
java.lang.Object
be.seeseemelk.mockbukkit.scoreboard.ObjectiveMock
- All Implemented Interfaces:
Objective
Mock implementation of an
Objective.-
Constructor Summary
ConstructorsConstructorDescriptionObjectiveMock(@NotNull ScoreboardMock scoreboard, @NotNull String name, @Nullable net.kyori.adventure.text.Component displayName, @NotNull Criteria criteria, @NotNull 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.@NotNull StringgetName()@NotNull RenderType@NotNull ScoreMock@NotNull ScoreMockgetScore(@NotNull OfflinePlayer player) Deprecated.@NotNull ScoregetScoreFor(@NotNull Entity entity) @NotNull CriteriabooleanbooleanChecks if the objective is still registered.@Nullable NumberFormatvoidnumberFormat(@Nullable NumberFormat numberFormat) voidsetAutoUpdateDisplay(boolean autoUpdateDisplay) voidsetDisplayName(@NotNull String displayName) Deprecated.voidsetDisplaySlot(@Nullable DisplaySlot slot) voidsetRenderType(@NotNull 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 Criteria criteria, @NotNull @NotNull 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 interfaceObjective- Throws:
IllegalStateException
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName() throws IllegalStateException- Specified by:
displayNamein interfaceObjective- Throws:
IllegalStateException
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component displayName) throws IllegalStateException, IllegalArgumentException - Specified by:
displayNamein interfaceObjective- Throws:
IllegalStateExceptionIllegalArgumentException
-
getDisplayName
@Deprecated(since="1.16") @NotNull public @NotNull String getDisplayName() throws IllegalStateExceptionDeprecated.- Specified by:
getDisplayNamein interfaceObjective- Throws:
IllegalStateException
-
setDisplayName
@Deprecated(since="1.16") public void setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException Deprecated.- Specified by:
setDisplayNamein interfaceObjective- Throws:
IllegalStateExceptionIllegalArgumentException
-
getCriteria
- Specified by:
getCriteriain interfaceObjective- Throws:
IllegalStateException
-
getTrackedCriteria
- Specified by:
getTrackedCriteriain interfaceObjective- Throws:
IllegalStateException
-
getScoreboard
- Specified by:
getScoreboardin interfaceObjective
-
unregister
- Specified by:
unregisterin interfaceObjective- 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
- Specified by:
setDisplaySlotin interfaceObjective- Throws:
IllegalStateException
-
getDisplaySlot
- Specified by:
getDisplaySlotin interfaceObjective- Throws:
IllegalStateException
-
setRenderType
- Specified by:
setRenderTypein interfaceObjective- Throws:
IllegalStateException
-
getRenderType
- Specified by:
getRenderTypein interfaceObjective- Throws:
IllegalStateException
-
getScore
@Deprecated(since="1.7.10") @NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException Deprecated.- Specified by:
getScorein interfaceObjective- Throws:
IllegalArgumentExceptionIllegalStateException
-
getScore
@NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull String entry) throws IllegalArgumentException, IllegalStateException - Specified by:
getScorein interfaceObjective- Throws:
IllegalArgumentExceptionIllegalStateException
-
getScoreFor
@NotNull public @NotNull Score getScoreFor(@NotNull @NotNull Entity entity) throws IllegalArgumentException, IllegalStateException - Specified by:
getScoreForin interfaceObjective- Throws:
IllegalArgumentExceptionIllegalStateException
-
willAutoUpdateDisplay
public boolean willAutoUpdateDisplay()- Specified by:
willAutoUpdateDisplayin interfaceObjective
-
setAutoUpdateDisplay
public void setAutoUpdateDisplay(boolean autoUpdateDisplay) - Specified by:
setAutoUpdateDisplayin interfaceObjective
-
numberFormat
- Specified by:
numberFormatin interfaceObjective
-
numberFormat
- Specified by:
numberFormatin interfaceObjective
-
isModifiable
- Specified by:
isModifiablein interfaceObjective- Throws:
IllegalStateException
-