Enum Class PlayerConfirmation
- All Implemented Interfaces:
Serializable, Comparable<PlayerConfirmation>, Constable
PlayerConfirmation
This enum stores all confirmation types for players, when they have to confirm their action.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThis record represents confirmation value, that stores type of confirmation and additional data.Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhen player searches worlds by id.When player searches worlds by name.When player searches worlds by owner.When new world's owner accepts taking ownership of world.When module's owner changes module's description.When module's owner changes module's display name.When player changes profile's description.When player changes profile's social link.When world's owner transfers ownership to other player.When world's owner changes world's custom id.When world's owner changes world's description.When world's owner changes world's name. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearConfirmations(@NotNull org.bukkit.entity.Player player) Removes any confirmation state from player.static @Nullable PlayerConfirmationgetConfirmation(@NotNull org.bukkit.entity.Player player) Returns player's confirmation type, or null.static @NotNull ObjectgetConfirmationData(@NotNull org.bukkit.entity.Player player) Returns data from player's confirmation state, or empty text "".static booleanhasConfirmation(@NotNull org.bukkit.entity.Player player) Checks whether player has confirmation state.static voidsetConfirmation(@NotNull org.bukkit.entity.Player player, @NotNull PlayerConfirmation confirmation) Sets player's confirmation state to specified type.static voidsetConfirmation(@NotNull org.bukkit.entity.Player player, @NotNull PlayerConfirmation confirmation, @Nullable Object data) Sets player's confirmation state to specified type.static PlayerConfirmationReturns the enum constant of this class with the specified name.static PlayerConfirmation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WORLD_NAME_CHANGE
When world's owner changes world's name. -
WORLD_DESCRIPTION_CHANGE
When world's owner changes world's description. -
WORLD_CUSTOM_ID_CHANGE
When world's owner changes world's custom id. -
FIND_PLANETS_BY_ID
When player searches worlds by id. -
FIND_PLANETS_BY_NAME
When player searches worlds by name. -
FIND_PLANETS_BY_OWNER
When player searches worlds by owner. -
TRANSFER_OWNERSHIP
When world's owner transfers ownership to other player. -
GET_OWNERSHIP
When new world's owner accepts taking ownership of world. -
MODULE_NAME_CHANGE
When module's owner changes module's display name. -
MODULE_DESCRIPTION_CHANGE
When module's owner changes module's description. -
PROFILE_DESCRIPTION
When player changes profile's description. -
PROFILE_SOCIAL_CHANGE
When player changes profile's social link.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
setConfirmation
public static void setConfirmation(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull PlayerConfirmation confirmation) Sets player's confirmation state to specified type.- Parameters:
player- player to set confirmation.confirmation- confirmation type to set.
-
setConfirmation
public static void setConfirmation(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull PlayerConfirmation confirmation, @Nullable @Nullable Object data) Sets player's confirmation state to specified type.- Parameters:
player- player to set confirmation.confirmation- confirmation type to set.data- additional data.
-
getConfirmation
@Nullable public static @Nullable PlayerConfirmation getConfirmation(@NotNull @NotNull org.bukkit.entity.Player player) Returns player's confirmation type, or null.- Parameters:
player- player to get confirmation type.- Returns:
- confirmation type, or null - if not found.
-
getConfirmationData
@NotNull public static @NotNull Object getConfirmationData(@NotNull @NotNull org.bukkit.entity.Player player) Returns data from player's confirmation state, or empty text "".- Parameters:
player- player to get confirmation additional data.- Returns:
- additional data or empty text "", if not exists.
-
clearConfirmations
public static void clearConfirmations(@NotNull @NotNull org.bukkit.entity.Player player) Removes any confirmation state from player.- Parameters:
player- player to clear confirmations.
-
hasConfirmation
public static boolean hasConfirmation(@NotNull @NotNull org.bukkit.entity.Player player) Checks whether player has confirmation state.- Parameters:
player- player to check.- Returns:
- true - player is in confirmation process, false - not.
-