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 TypeMethodDescription@NotNull CompletableFuture<Void> delete()Delete all protections of this player.@Nullable BlockProtectionInfogetBlockProtection(long key) Get information about a specific block protection.intGet the amount of block protections.@NotNull com.github.angeschossen.pluginframework.api.trusted.group.GroupGet the default group.intGet the amount of entity protections.@Nullable com.github.angeschossen.pluginframework.api.trusted.group.GroupGet a group by its name.@NotNull List<? extends com.github.angeschossen.pluginframework.api.trusted.group.Group> Get all group of this player.@NotNull UUIDgetUID()Get the player's identificationbooleanhasData()Check if the player has any protections or any changed (different than default) flags.booleanhasFlag(@NotNull PlayerFlag flag) Check if a player has a specific flag set.booleantoggleFlag(@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, refreshLimitPackMethods inherited from interface com.github.angeschossen.pluginframework.api.player.PlayerData
getCommandSender, getPlayerMethods inherited from interface com.github.angeschossen.pluginframework.api.player.PlayerDataBase
getBedrockGUILocale, getGUILocale, getLocale, getMessages, getName, getServer, getUUID, sendMessage
-
Method Details
-
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
Check if a player has a specific flag set.- Parameters:
flag- the flag- Returns:
- true, if flag is set
-
toggleFlag
Toggle a flag for the player.- Parameters:
flag- the flag to toggle- Returns:
- the new state
-
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 includegetDefaultGroup(), 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
Get information about a specific block protection.- Parameters:
key- protection ID- Returns:
- null, if player doesn't have a protection with this id
-