Interface IPlot


public interface IPlot
Represents a plot within the ScalaPlot system. This interface provides comprehensive management of plot data, including ownership, membership, banning, and behavioral flags.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBanned(UUID player)
    Bans a player from entering or interacting with this plot.
    void
    Internally connects a plot to this one.
    void
    addMember(UUID player)
    Adds a player to the trusted members list.
    void
    addRating(UUID player, int rating)
    Adds a rating from a player.
    boolean
    canBuild(UUID player)
    Checks if a player has permission to build on this plot.
    deletePlot(org.bukkit.entity.Player player, IPlot plot)
    Deletes the plot, resetting its physical blocks and clearing data.
    double
    Calculates the average rating of the plot.
    Gets a set of all players banned from this plot.
    org.bukkit.Location
    Gets the center location of the plot.
    Gets all plots connected/merged with this one.
    boolean
    Gets the value of a specific flag.
    Gets all currently set flags for this plot.
    Gets the unique identifier of this plot.
    Gets a set of all trusted members for this plot.
    Gets the custom name of the plot.
    Gets the UUID of the plot owner.
    Gets the rating given by a specific player.
    int
    Gets the total number of ratings received.
    boolean
    Checks if the plot currently has an owner.
    boolean
    isBanned(UUID player)
    Checks if a player is currently banned from this plot.
    boolean
    isMember(UUID player)
    Checks if a player is currently trusted on this plot.
    boolean
    isOwner(UUID player)
    Checks if a specific player is the owner of this plot.
    void
    Removes a player from the banned list.
    void
    Internally disconnects a plot from this one.
    void
    Removes a player from the trusted members list.
    boolean
    Resets the plot metadata (owner, members, etc.) to default values.
    void
    setFlag(PlotFlag flag, boolean value)
    Sets a specific flag for this plot.
    void
    Sets a custom name for the plot.
    boolean
    setOwner(UUID owner)
    Sets the plot owner and triggers the appropriate events.
    void
    Sets the plot owner without triggering events or notifications.
  • Method Details

    • getId

      PlotId getId()
      Gets the unique identifier of this plot.
      Returns:
      The PlotId of the plot.
    • getOwner

      UUID getOwner()
      Gets the UUID of the plot owner.
      Returns:
      The UUID of the owner, or null if the plot is unclaimed.
    • setOwnerSilent

      void setOwnerSilent(UUID owner)
      Sets the plot owner without triggering events or notifications. Internal use recommended.
      Parameters:
      owner - The new owner's UUID.
    • setOwner

      boolean setOwner(UUID owner)
      Sets the plot owner and triggers the appropriate events.
      Parameters:
      owner - The new owner's UUID.
      Returns:
      true if the owner was changed successfully, false if cancelled or same owner.
    • hasOwner

      boolean hasOwner()
      Checks if the plot currently has an owner.
      Returns:
      true if owned, false if unclaimed.
    • isOwner

      boolean isOwner(UUID player)
      Checks if a specific player is the owner of this plot.
      Parameters:
      player - The UUID of the player to check.
      Returns:
      true if the player is the owner.
    • getName

      String getName()
      Gets the custom name of the plot.
      Returns:
      The name string.
    • setName

      void setName(String name)
      Sets a custom name for the plot.
      Parameters:
      name - The new name for the plot.
    • getMembers

      Set<UUID> getMembers()
      Gets a set of all trusted members for this plot.
      Returns:
      A Set of UUIDs of trusted members.
    • addMember

      void addMember(UUID player)
      Adds a player to the trusted members list.
      Parameters:
      player - The UUID of the player to trust.
    • removeMember

      void removeMember(UUID player)
      Removes a player from the trusted members list.
      Parameters:
      player - The UUID of the player to untrust.
    • isMember

      boolean isMember(UUID player)
      Checks if a player is currently trusted on this plot.
      Parameters:
      player - The UUID of the player to check.
      Returns:
      true if the player is a member.
    • getBanned

      Set<UUID> getBanned()
      Gets a set of all players banned from this plot.
      Returns:
      A Set of UUIDs of banned players.
    • addBanned

      void addBanned(UUID player)
      Bans a player from entering or interacting with this plot.
      Parameters:
      player - The UUID of the player to ban.
    • removeBanned

      void removeBanned(UUID player)
      Removes a player from the banned list.
      Parameters:
      player - The UUID of the player to unban.
    • isBanned

      boolean isBanned(UUID player)
      Checks if a player is currently banned from this plot.
      Parameters:
      player - The UUID of the player to check.
      Returns:
      true if the player is banned.
    • canBuild

      boolean canBuild(UUID player)
      Checks if a player has permission to build on this plot. Usually true for owners and members.
      Parameters:
      player - The UUID of the player to check.
      Returns:
      true if the player can build.
    • setFlag

      void setFlag(PlotFlag flag, boolean value)
      Sets a specific flag for this plot.
      Parameters:
      flag - The PlotFlag to set.
      value - The value to apply.
    • getFlag

      boolean getFlag(PlotFlag flag)
      Gets the value of a specific flag.
      Parameters:
      flag - The PlotFlag to check.
      Returns:
      true if the flag is enabled, false otherwise.
    • getFlags

      Map<PlotFlag,Boolean> getFlags()
      Gets all currently set flags for this plot.
      Returns:
      A Map of flags and their boolean values.
    • getConnectedPlots

      Set<PlotId> getConnectedPlots()
      Gets all plots connected/merged with this one.
      Returns:
      A Set of PlotIds.
    • addConnectedPlot

      void addConnectedPlot(PlotId plotId)
      Internally connects a plot to this one.
      Parameters:
      plotId - The ID of the plot to connect.
    • removeConnectedPlot

      void removeConnectedPlot(PlotId plotId)
      Internally disconnects a plot from this one.
      Parameters:
      plotId - The ID of the plot to disconnect.
    • getAverageRating

      double getAverageRating()
      Calculates the average rating of the plot.
      Returns:
      A double value between 0.0 and 5.0.
    • getRatingCount

      int getRatingCount()
      Gets the total number of ratings received.
      Returns:
      The rating count.
    • addRating

      void addRating(UUID player, int rating)
      Adds a rating from a player.
      Parameters:
      player - The player's UUID.
      rating - The rating value (usually 1-5).
    • getPlayerRating

      Integer getPlayerRating(UUID player)
      Gets the rating given by a specific player.
      Parameters:
      player - The player's UUID.
      Returns:
      The rating value, or null if not rated.
    • reset

      boolean reset()
      Resets the plot metadata (owner, members, etc.) to default values.
      Returns:
      true if reset successful.
    • deletePlot

      CompletableFuture<PlotResetResult> deletePlot(org.bukkit.entity.Player player, IPlot plot)
      Deletes the plot, resetting its physical blocks and clearing data.
      Parameters:
      player - The player initiating the deletion.
      plot - The plot to delete.
      Returns:
      A CompletableFuture with the PlotResetResult.
    • getCenter

      org.bukkit.Location getCenter()
      Gets the center location of the plot.
      Returns:
      The Location of the plot center.