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 newObjectiveMock
with the provided parameters. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.Component
void
displayName
(@Nullable net.kyori.adventure.text.Component displayName) @NotNull String
@NotNull String
Deprecated.@NotNull String
getName()
@NotNull RenderType
@NotNull ScoreMock
@NotNull ScoreMock
getScore
(@NotNull OfflinePlayer player) Deprecated.@NotNull Score
getScoreFor
(@NotNull Entity entity) @NotNull Criteria
boolean
boolean
Checks if the objective is still registered.void
setDisplayName
(@NotNull String displayName) Deprecated.void
setDisplaySlot
(@Nullable DisplaySlot slot) void
setRenderType
(@NotNull RenderType renderType) void
-
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 newObjectiveMock
with 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:
getName
in interfaceObjective
- Throws:
IllegalStateException
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName() throws IllegalStateException- Specified by:
displayName
in interfaceObjective
- Throws:
IllegalStateException
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component displayName) throws IllegalStateException, IllegalArgumentException - Specified by:
displayName
in interfaceObjective
- Throws:
IllegalStateException
IllegalArgumentException
-
getDisplayName
@Deprecated(since="1.16") @NotNull public @NotNull String getDisplayName() throws IllegalStateExceptionDeprecated.- Specified by:
getDisplayName
in interfaceObjective
- Throws:
IllegalStateException
-
setDisplayName
@Deprecated(since="1.16") public void setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException Deprecated.- Specified by:
setDisplayName
in interfaceObjective
- Throws:
IllegalStateException
IllegalArgumentException
-
getCriteria
- Specified by:
getCriteria
in interfaceObjective
- Throws:
IllegalStateException
-
getTrackedCriteria
- Specified by:
getTrackedCriteria
in interfaceObjective
- Throws:
IllegalStateException
-
getScoreboard
- Specified by:
getScoreboard
in interfaceObjective
-
unregister
- Specified by:
unregister
in interfaceObjective
- Throws:
IllegalStateException
-
isRegistered
public boolean isRegistered()Checks if the objective is still registered.- Returns:
true
if the objective is still registered,false
if it has been unregistered.
-
setDisplaySlot
- Specified by:
setDisplaySlot
in interfaceObjective
- Throws:
IllegalStateException
-
getDisplaySlot
- Specified by:
getDisplaySlot
in interfaceObjective
- Throws:
IllegalStateException
-
setRenderType
- Specified by:
setRenderType
in interfaceObjective
- Throws:
IllegalStateException
-
getRenderType
- Specified by:
getRenderType
in interfaceObjective
- Throws:
IllegalStateException
-
getScore
@Deprecated(since="1.7.10") @NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException Deprecated.- Specified by:
getScore
in interfaceObjective
- Throws:
IllegalArgumentException
IllegalStateException
-
getScore
@NotNull public @NotNull ScoreMock getScore(@NotNull @NotNull String entry) throws IllegalArgumentException, IllegalStateException - Specified by:
getScore
in interfaceObjective
- Throws:
IllegalArgumentException
IllegalStateException
-
getScoreFor
@NotNull public @NotNull Score getScoreFor(@NotNull @NotNull Entity entity) throws IllegalArgumentException, IllegalStateException - Specified by:
getScoreFor
in interfaceObjective
- Throws:
IllegalArgumentException
IllegalStateException
-
isModifiable
- Specified by:
isModifiable
in interfaceObjective
- Throws:
IllegalStateException
-