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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionStatusInstance(@NotNull String statusId, @Nullable Set<org.bukkit.permissions.Permission> permissions, @Nullable Set<org.bukkit.scoreboard.Team> teams, @Nullable net.kyori.adventure.text.Component display) -
Method Summary
Modifier and TypeMethodDescriptionallowPlayer(org.bukkit.entity.Player player) Checks if the given player can have this status.static StatusInstancedeserialize(Map<String, Object> map, @NotNull String statusId) @NotNull net.kyori.adventure.text.Component@NotNull org.bukkit.NamespacedKeygetKey()@Nullable Set<org.bukkit.permissions.Permission> Gets an optional set of Permissions, of which at least one is required to set this status.@NotNull String@Nullable Set<org.bukkit.scoreboard.Team> getTeams()Gets an optional set of Teams, of which at least one is required to set this status.
-
Constructor Details
-
StatusInstance
-
-
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
- Returns:
- The id of this status.
This is also displayed as the tab completion inside the '/status set ...' command.
-
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
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
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
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
-
deserialize
-
getKey
@NotNull public @NotNull org.bukkit.NamespacedKey getKey()- Specified by:
getKeyin interfaceorg.bukkit.Keyed
-