Class StatusInstance

java.lang.Object
net.mathias2246.buildmc.api.status.StatusInstance
All Implemented Interfaces:
org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.Keyed

public class StatusInstance extends Object implements org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.Keyed
The instance of a status that shows up inside the '/status set ...' command when registered.
  • Constructor Details

    • StatusInstance

      public StatusInstance(@NotNull @NotNull String statusId, @Nullable @Nullable Set<org.bukkit.permissions.Permission> permissions, @Nullable @Nullable Set<org.bukkit.scoreboard.Team> teams, @Nullable @Nullable net.kyori.adventure.text.Component display)
  • Method Details

    • getDisplay

      @NotNull public @NotNull net.kyori.adventure.text.Component getDisplay()
      Returns:
      The Text-Component that is displayed as a prefix before the players name.
    • getStatusId

      @NotNull public @NotNull String getStatusId()
      Returns:
      The id of this status.

      This is also displayed as the tab completion inside the '/status set ...' command.

    • getPermissions

      @Nullable public @Nullable Set<org.bukkit.permissions.Permission> getPermissions()
      Gets an optional set of Permissions, of which at least one is required to set this status.
      Returns:
      The list of permissions, or null if not required.
    • getTeams

      @Nullable public @Nullable Set<org.bukkit.scoreboard.Team> getTeams()
      Gets an optional set of Teams, of which at least one is required to set this status.
      Returns:
      The list of teams, or null if not required.
    • allowPlayer

      public StatusInstance.AllowStatus allowPlayer(org.bukkit.entity.Player player)
      Checks if the given player can have this status.
      Returns:
      True if, the player has the optional permissions and or team and is not null.
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
    • deserialize

      public static StatusInstance deserialize(Map<String,Object> map, @NotNull @NotNull String statusId)
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
      Specified by:
      getKey in interface org.bukkit.Keyed