Interface ProtectOfflinePlayer

All Superinterfaces:
com.github.angeschossen.pluginframework.api.limit.holder.LimitHolder, com.github.angeschossen.pluginframework.api.player.PlayerData, com.github.angeschossen.pluginframework.api.player.PlayerDataBase
All Known Subinterfaces:
ProtectPlayer

public interface ProtectOfflinePlayer extends com.github.angeschossen.pluginframework.api.player.PlayerData
Represents a player's ChestProtect data. Works for both online and offline players. For online players, use ProtectPlayer instead.
  • Field Summary

    Fields inherited from interface com.github.angeschossen.pluginframework.api.limit.holder.LimitHolder

    LIMIT_DISPLAY_AS_UNLIMITED_BORDER
  • Method Summary

    Modifier and Type
    Method
    Description
    Delete all protections of this player.
    Get information about a specific block protection.
    int
    Get the amount of block protections.
    @NotNull com.github.angeschossen.pluginframework.api.trusted.group.Group
    Get the default group.
    int
    Get the amount of entity protections.
    @Nullable com.github.angeschossen.pluginframework.api.trusted.group.Group
    getGroup(@NotNull String plainName)
    Get a group by its name.
    @NotNull List<? extends com.github.angeschossen.pluginframework.api.trusted.group.Group>
    Get all group of this player.
    @NotNull UUID
    Get the player's identification
    boolean
    Check if the player has any protections or any changed (different than default) flags.
    boolean
    hasFlag(@NotNull PlayerFlag flag)
    Check if a player has a specific flag set.
    boolean
    toggleFlag(@NotNull PlayerFlag flag)
    Toggle a flag for the player.

    Methods inherited from interface com.github.angeschossen.pluginframework.api.limit.holder.LimitHolder

    getLimit, getLimit, getLimitAsString, hasLimitPack, onLimitChanged, onLimitPackChanged, refreshLimitPack

    Methods inherited from interface com.github.angeschossen.pluginframework.api.player.PlayerData

    getCommandSender, getPlayer

    Methods inherited from interface com.github.angeschossen.pluginframework.api.player.PlayerDataBase

    getBedrockGUILocale, getGUILocale, getLocale, getMessages, getName, getServer, getUUID, sendMessage
  • Method Details

    • getUID

      @NotNull @NotNull UUID getUID()
      Get the player's identification
      Returns:
      UUID of the player
    • getGroup

      @Nullable @Nullable com.github.angeschossen.pluginframework.api.trusted.group.Group getGroup(@NotNull @NotNull String plainName)
      Get a group by its name.
      Parameters:
      plainName - name without color
      Returns:
      null, if the player has no group with that name
    • getDefaultGroup

      @NotNull @NotNull com.github.angeschossen.pluginframework.api.trusted.group.Group getDefaultGroup()
      Get the default group.
      Returns:
      New protections will belong to this group, if their block type isn't part of any group yet.
    • hasFlag

      boolean hasFlag(@NotNull @NotNull PlayerFlag flag)
      Check if a player has a specific flag set.
      Parameters:
      flag - the flag
      Returns:
      true, if flag is set
    • toggleFlag

      boolean toggleFlag(@NotNull @NotNull PlayerFlag flag)
      Toggle a flag for the player.
      Parameters:
      flag - the flag to toggle
      Returns:
      the new state
    • delete

      @NotNull @NotNull CompletableFuture<Void> delete()
      Delete all protections of this player.
      Returns:
      never null
    • hasData

      boolean hasData()
      Check if the player has any protections or any changed (different than default) flags.
      Returns:
      false, if the player has no protections or flags set
    • getGroups

      @NotNull @NotNull List<? extends com.github.angeschossen.pluginframework.api.trusted.group.Group> getGroups()
      Get all group of this player. Might not include getDefaultGroup(), if the default group was never requested before.
      Returns:
      groups of this player
    • getBlockProtectionsAmount

      int getBlockProtectionsAmount()
      Get the amount of block protections.
      Returns:
      amount of block protections
    • getEntityProtectionsAmount

      int getEntityProtectionsAmount()
      Get the amount of entity protections.
      Returns:
      amount of entity protections
    • getBlockProtection

      @Nullable @Nullable BlockProtectionInfo getBlockProtection(long key)
      Get information about a specific block protection.
      Parameters:
      key - protection ID
      Returns:
      null, if player doesn't have a protection with this id