Class ScoreboardState
java.lang.Object
wbs.utils.util.entities.state.tracker.ScoreboardState
- All Implemented Interfaces:
EntityState<org.bukkit.entity.Player>
- See Also:
-
Player.getScoreboard()
-
Constructor Summary
ConstructorsConstructorDescriptionCreates the state with no scoreboard configured.ScoreboardState(@Nullable org.bukkit.scoreboard.Scoreboard scoreboard) -
Method Summary
Modifier and TypeMethodDescriptionvoidcaptureState(org.bukkit.entity.Player target) Capture the state of an instance ofEntityStateaccording to the implementation, and store it untilEntityState.restoreState(T)is called.@Nullable org.bukkit.scoreboard.Scoreboard@NotNull Set<Class<? extends EntityState<?>>>Used to build a graph of captured states, allowing states to be restored in the appropriate order, such as restoringAllowFlightStateafterGameModeState, to prevent a change toGameMode.SURVIVALfrom overriding thePlayer.getAllowFlight()state.voidrestoreState(org.bukkit.entity.Player target) Restore the state of an instance ofEntityStateaccording to the implementation.voidsetScoreboard(@Nullable org.bukkit.scoreboard.Scoreboard scoreboard)
-
Constructor Details
-
ScoreboardState
public ScoreboardState()Creates the state with no scoreboard configured. -
ScoreboardState
public ScoreboardState(@Nullable @Nullable org.bukkit.scoreboard.Scoreboard scoreboard) - Parameters:
scoreboard- The scoreboard shown to the player.
-
-
Method Details
-
captureState
public void captureState(org.bukkit.entity.Player target) Description copied from interface:EntityStateCapture the state of an instance ofEntityStateaccording to the implementation, and store it untilEntityState.restoreState(T)is called.- Specified by:
captureStatein interfaceEntityState<org.bukkit.entity.Player>- Parameters:
target- TheEntityStatefrom which to capture.
-
restoreState
public void restoreState(org.bukkit.entity.Player target) Description copied from interface:EntityStateRestore the state of an instance ofEntityStateaccording to the implementation.- Specified by:
restoreStatein interfaceEntityState<org.bukkit.entity.Player>- Parameters:
target- TheEntityStatefor which to the stored state.
-
getScoreboard
@Nullable public @Nullable org.bukkit.scoreboard.Scoreboard getScoreboard()- Returns:
- The scoreboard shown to the player.
-
setScoreboard
public void setScoreboard(@Nullable @Nullable org.bukkit.scoreboard.Scoreboard scoreboard) - Parameters:
scoreboard- The scoreboard shown to the player.
-
restoreAfter
Description copied from interface:EntityStateUsed to build a graph of captured states, allowing states to be restored in the appropriate order, such as restoringAllowFlightStateafterGameModeState, to prevent a change toGameMode.SURVIVALfrom overriding thePlayer.getAllowFlight()state.- Specified by:
restoreAfterin interfaceEntityState<org.bukkit.entity.Player>- Returns:
- A set of classes to restore after, if present in a given
SavedEntityState.
-