Interface PublicAPI


public interface PublicAPI
Main interface for external plugins to interact with ScalaPlot. This class provides methods to retrieve, manage, and interact with plots.
  • Method Details

    • getPlotAt

      IPlot getPlotAt(org.bukkit.Location location)
      Gets the plot at a specific location.
      Parameters:
      location - The Location to check.
      Returns:
      An IPlot instance, or null if not in a plot.
    • getPlotsByOwner

      List<IPlot> getPlotsByOwner(UUID ownerId)
      Gets all plots owned by a specific player.
      Parameters:
      ownerId - The UUID of the owner.
      Returns:
      A List of IPlots owned by the player.
    • getPlotById

      IPlot getPlotById(PlotId id)
      Gets a plot by its specific ID.
      Parameters:
      id - The PlotId of the plot.
      Returns:
      An IPlot instance, or null if the plot doesn't exist.
    • getPlotCount

      int getPlotCount(UUID playerId)
      Gets the total number of plots owned by a specific player.
      Parameters:
      playerId - The UUID of the player.
      Returns:
      The plot count.
    • getAllPlots

      Collection<IPlot> getAllPlots()
      Gets all plots in the system.
      Returns:
      A Collection of all IPlots.
    • isTrusted

      boolean isTrusted(IPlot plot, UUID playerId)
      Checks if a player is trusted on a specific plot.
      Parameters:
      plot - The plot to check.
      playerId - The UUID of the player.
      Returns:
      true if trusted.
    • isBanned

      boolean isBanned(IPlot plot, UUID playerId)
      Checks if a player is banned from a specific plot.
      Parameters:
      plot - The plot to check.
      playerId - The UUID of the player.
      Returns:
      true if banned.
    • banPlayer

      void banPlayer(IPlot plot, UUID playerId)
      Bans a player from a specific plot.
      Parameters:
      plot - The plot to ban from.
      playerId - The UUID of the player to ban.
    • unbanPlayer

      void unbanPlayer(IPlot plot, UUID playerId)
      Unbans a player from a specific plot.
      Parameters:
      plot - The plot to unban from.
      playerId - The UUID of the player to unban.
    • getPlotOwner

      UUID getPlotOwner(IPlot plot)
      Gets the owner of a specific plot.
      Parameters:
      plot - The plot to check.
      Returns:
      The owner's UUID, or null if unclaimed.
    • getPlotCenter

      org.bukkit.Location getPlotCenter(IPlot plot)
      Gets the center of a specific plot.
      Parameters:
      plot - The plot to check.
      Returns:
      The center Location of the plot.
    • trustPlayer

      void trustPlayer(IPlot plot, UUID playerId)
      Trusts a player on a specific plot.
      Parameters:
      plot - The plot to trust on.
      playerId - The UUID of the player to trust.
    • untrustPlayer

      void untrustPlayer(IPlot plot, UUID playerId)
      Untrusts a player from a specific plot.
      Parameters:
      plot - The plot to untrust from.
      playerId - The UUID of the player to untrust.
    • getTruestedPlayers

      Set<UUID> getTruestedPlayers(IPlot plot)
      Gets all trusted players on a specific plot.
      Parameters:
      plot - The plot to check.
      Returns:
      A Set of UUIDs of trusted players.
    • getBannedPlayers

      Set<UUID> getBannedPlayers(IPlot plot)
      Gets all banned players on a specific plot.
      Parameters:
      plot - The plot to check.
      Returns:
      A Set of UUIDs of banned players.
    • claimPlot

      ClaimResult claimPlot(org.bukkit.entity.Player player)
      Claims a plot for the player.
      Parameters:
      player - The Player who wants to claim a plot.
      Returns:
      The ClaimResult of the claim attempt.
    • resetPlot

      void resetPlot(IPlot plot)
      Resets a specific plot's metadata to default values.
      Parameters:
      plot - The plot to reset.
    • deletePlot

      CompletableFuture<PlotResetResult> deletePlot(org.bukkit.entity.Player player, IPlot plot)
      Deletes a specific plot, resetting blocks and metadata.
      Parameters:
      player - The player initiating the deletion.
      plot - The plot to delete.
      Returns:
      A CompletableFuture with the PlotResetResult.
    • canBeClaimed

      boolean canBeClaimed(IPlot plot)
      Checks if a plot is currently available to be claimed.
      Parameters:
      plot - The plot to check.
      Returns:
      true if available.
    • getAverageRating

      double getAverageRating(IPlot plot)
      Gets the average rating of a specific plot.
      Parameters:
      plot - The plot to check.
      Returns:
      A double between 0.0 and 5.0.