Interface ChestProtectAPI


public interface ChestProtectAPI
Main entry point for the ChestProtect API. Obtain the instance via getInstance().
  • Method Details

    • getInstance

      @NotNull static @NotNull ChestProtectAPI getInstance()
      Get implementation of the API.
      Returns:
      API implementation
    • getProtectionWorlds

      @NotNull @NotNull Collection<? extends ProtectionWorld> 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, use getProtectPlayer(Player) instead.
      Parameters:
      uuid - the player's uuid
      Returns:
      never null
    • getProtectionManager

      @NotNull @NotNull ProtectionManager 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 use getProtectOfflinePlayer(UUID) instead.
      Parameters:
      player - The player
      Returns:
      null, if not online and already unloaded.
    • getProtectionWorld

      @Nullable @Nullable ProtectionWorld getProtectionWorld(@NotNull @NotNull org.bukkit.World world)
      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