Package me.angeschossen.chestprotect.api
Interface ChestProtectAPI
public interface ChestProtectAPI
Main entry point for the ChestProtect API.
Obtain the instance via
getInstance().-
Method Summary
Modifier and TypeMethodDescription@Nullable BlockProtectiongetBlockProtectionByBlock(@NotNull org.bukkit.block.Block block) Get block protection.@Nullable BlockProtectiongetBlockProtectionByPos(@NotNull com.github.angeschossen.pluginframework.api.blockutil.BlockPosition position) Get block protection.@Nullable EntityProtectiongetEntityProtection(@NotNull org.bukkit.entity.Entity entity) Get entity protection.static @NotNull ChestProtectAPIGet implementation of the API.@NotNull ProtectionManagerGet protection manager.@Nullable ProtectionWorldgetProtectionWorld(@NotNull org.bukkit.World world) Get world that contains all loaded protections.@NotNull Collection<? extends ProtectionWorld> Get world related data.@NotNull CompletableFuture<? extends ProtectOfflinePlayer> getProtectOfflinePlayer(@NotNull UUID uuid) Get information about an offline player.@Nullable ProtectPlayergetProtectPlayer(@NotNull org.bukkit.entity.Player player) Get online player.
-
Method Details
-
getInstance
Get implementation of the API.- Returns:
- API implementation
-
getProtectionWorlds
Get world related data.- Returns:
- all worlds that have protections enabled and are loaded
-
getProtectOfflinePlayer
@NotNull @NotNull CompletableFuture<? extends ProtectOfflinePlayer> getProtectOfflinePlayer(@NotNull @NotNull UUID uuid) Get information about an offline player. For online players, usegetProtectPlayer(Player)instead.- Parameters:
uuid- the player's uuid- Returns:
- never null
-
getProtectionManager
Get protection manager.- Returns:
- Initialized protection manager
-
getProtectPlayer
@Nullable @Nullable ProtectPlayer getProtectPlayer(@NotNull @NotNull org.bukkit.entity.Player player) Get online player. For offline players usegetProtectOfflinePlayer(UUID)instead.- Parameters:
player- The player- Returns:
- null, if not online and already unloaded.
-
getProtectionWorld
Get world that contains all loaded protections.- Parameters:
world- World- Returns:
- null, if protections aren't enabled in that world or the world isn't loaded anymore.
-
getEntityProtection
@Nullable @Nullable EntityProtection getEntityProtection(@NotNull @NotNull org.bukkit.entity.Entity entity) Get entity protection.- Parameters:
entity- The entity- Returns:
- null, if not protected
-
getBlockProtectionByBlock
@Nullable @Nullable BlockProtection getBlockProtectionByBlock(@NotNull @NotNull org.bukkit.block.Block block) Get block protection.- Parameters:
block- the block- Returns:
- null, if not protected or chunk unloaded
-
getBlockProtectionByPos
@Nullable @Nullable BlockProtection getBlockProtectionByPos(@NotNull @NotNull com.github.angeschossen.pluginframework.api.blockutil.BlockPosition position) Get block protection.- Parameters:
position- position of the block- Returns:
- null, if not protected or chunk unloaded
-