com.intellectualcrafters.plot.api

## Class PlotAPI

- java.lang.Object
- - com.intellectualcrafters.plot.api.PlotAPI

-     public class PlotAPI
      extends java.lang.Object

  The plotMain api class.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ADMIN_PERMISSION` Admin Permission

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlotAPI(org.bukkit.plugin.java.JavaPlugin plugin)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFlag(AbstractFlag flag)` Register a flag for use in plots
    `void` | `addPlotWorld(java.lang.String world, PlotWorld plotWorld, PlotManager manager)` Add a plotoworld
    `int` | `getAllowedPlots(org.bukkit.entity.Player player)` Get the allowed plot count for a player
    `java.util.Set<Plot>` | `getAllPlots()` Get all plots
    `org.bukkit.Location` | `getBottomLocation(Plot p)` Get Bottom Location
    `C` | `getCaptions()` C class contains all the captions from the translations.yml file.
    `org.bukkit.configuration.file.YamlConfiguration` | `getConfig()`
    `FlagManager` | `getFlagManager()` FlagManager class contains methods relating to plot flags
    `AbstractFlag[]` | `getFlags()` get all the currently registered flags
    `org.bukkit.Location` | `getHomeLocation(Plot p)` Get home location
    `org.bukkit.Location[]` | `getLocations(Plot p)` Get plot locations
    `PlotMain` | `getMain()` Get the main class for this plugin - Contains a lot of fields and methods - not very well organized Only use this if you really need it
    `PlayerFunctions` | `getPlayerFunctions()` PlayerFunctions class contains useful methods relating to players - Some player/plot methods are here as well
    `int` | `getPlayerPlotCount(org.bukkit.World world, org.bukkit.entity.Player player)` Get the player plot count
    `java.util.Set<Plot>` | `getPlayerPlots(org.bukkit.entity.Player player)` Return all plots for a player
    `java.util.Set<Plot>` | `getPlayerPlots(org.bukkit.World world, org.bukkit.entity.Player player)` Get a players plots
    `Plot` | `getPlot(org.bukkit.Location l)` Get a plot based on the location
    `Plot` | `getPlot(org.bukkit.entity.Player player)` Get a plot based on the player location
    `Plot` | `getPlot(org.bukkit.World world, int x, int z)` Get a plot based on the ID
    `PlotHelper` | `getPlotHelper()` PlotHelper class contains useful methods relating to plots.
    `PlotMain` | `getPlotMain()` Get the plotMain class
    `PlotManager` | `getPlotManager(java.lang.String world)` Get the plot manager for a world. - Contains useful low level methods for plot merging, clearing, and tessellation
    `PlotManager` | `getPlotManager(org.bukkit.World world)` Get the plot manager for a world. - Most of these methods can be accessed through the PlotHelper
    `Plot[]` | `getPlots(org.bukkit.World world)` Get all plots for the world
    `Plot[]` | `getPlots(org.bukkit.World world, org.bukkit.entity.Player plr, boolean just_owner)` Get all plots for the player
    `java.lang.String[]` | `getPlotWorlds()` Get all plot worlds
    `SchematicHandler` | `getSchematicHandler()` SchematicHandler class contains methods related to pasting schematics
    `org.bukkit.configuration.file.YamlConfiguration` | `getStorage()`
    `org.bukkit.Location` | `getTopLocation(Plot p)` Get Top Location
    `PlotWorld` | `getWorldSettings(java.lang.String world)` Get the settings for a world (settings bundled in PlotWorld class)
    `PlotWorld` | `getWorldSettings(org.bukkit.World world)` Get the settings for a world (settings bundled in PlotWorld class) - You will need to downcast for the specific settings a Generator has. e.g.
    `boolean` | `hasPlot(org.bukkit.World world, org.bukkit.entity.Player player)` Check whether or not a player has a plot
    `boolean` | `isInPlot(org.bukkit.entity.Player player)` Check whether or not a player is in a plot
    `boolean` | `isPlotWorld(org.bukkit.World world)` Get if plot world
    `void` | `registerCommand(SubCommand c)` Register a subcommand
    `void` | `sendConsoleMessage(C c)` Send a message to the console
    `void` | `sendConsoleMessage(java.lang.String msg)` Send a message to the console. - Supports color codes
    `void` | `sendMessage(org.bukkit.entity.Player player, C c)` Send a message to a player.
    `void` | `sendMessage(org.bukkit.entity.Player player, java.lang.String string)` Send a message to a player. - Supports color codes

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ADMIN_PERMISSION

          public static final java.lang.String ADMIN_PERMISSION

      Admin Permission
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PlotAPI

          public PlotAPI(org.bukkit.plugin.java.JavaPlugin plugin)

      Constructor. Insert any Plugin. (Optimally the plugin that is accessing the method)
      Parameters:
        `plugin` - Plugin used to access this method

  - ### Method Detail

    - #### getAllPlots

          public java.util.Set<Plot> getAllPlots()

      Get all plots
      Returns:
        all plots

    - #### getPlayerPlots

          public java.util.Set<Plot> getPlayerPlots(org.bukkit.entity.Player player)

      Return all plots for a player
      Parameters:
        `player` -
      Returns:
        all plots that a player owns

    - #### addPlotWorld

          public void addPlotWorld(java.lang.String world,
                          PlotWorld plotWorld,
                          PlotManager manager)

      Add a plotoworld
      Parameters:
        `world` - World Name
        `plotWorld` - Plot World Object
        `manager` - World Manager
      See Also:
        `PlotMain.addPlotWorld(String, com.intellectualcrafters.plot.object.PlotWorld, com.intellectualcrafters.plot.object.PlotManager)`

    - #### getConfig

          public org.bukkit.configuration.file.YamlConfiguration getConfig()

      Returns:
        main configuration
      See Also:
        `PlotMain.config`

    - #### getStorage

          public org.bukkit.configuration.file.YamlConfiguration getStorage()

      Returns:
        storage configuration
      See Also:
        `PlotMain.storage`

    - #### getMain

          public PlotMain getMain()

      Get the main class for this plugin
      - Contains a lot of fields and methods - not very well organized
      Only use this if you really need it
      Returns:
        PlotMain PlotSquared Main Class

    - #### getPlotHelper

          public PlotHelper getPlotHelper()

      PlotHelper class contains useful methods relating to plots.
      Returns:
        PlotHelper

    - #### getPlayerFunctions

          public PlayerFunctions getPlayerFunctions()

      PlayerFunctions class contains useful methods relating to players - Some player/plot methods are here as well
      Returns:
        PlayerFunctions

    - #### getFlagManager

          public FlagManager getFlagManager()

      FlagManager class contains methods relating to plot flags
      Returns:
        FlagManager

    - #### getSchematicHandler

          public SchematicHandler getSchematicHandler()

      SchematicHandler class contains methods related to pasting schematics
      Returns:
        SchematicHandler

    - #### getCaptions

          public C getCaptions()

      C class contains all the captions from the translations.yml file.
      Returns:
        C

    - #### getPlotManager

          public PlotManager getPlotManager(org.bukkit.World world)

      Get the plot manager for a world. - Most of these methods can be accessed through the PlotHelper
      Parameters:
        `world` -
      Returns:
        PlotManager

    - #### getPlotManager

          public PlotManager getPlotManager(java.lang.String world)

      Get the plot manager for a world. - Contains useful low level methods for plot merging, clearing, and tessellation
      Parameters:
        `world` -
      Returns:
        PlotManager

    - #### getWorldSettings

          public PlotWorld getWorldSettings(org.bukkit.World world)

      Get the settings for a world (settings bundled in PlotWorld class) - You will need to downcast for the specific settings a Generator has. e.g. DefaultPlotWorld class implements PlotWorld
      Parameters:
        `world` - (to get settings of)
      Returns:
        PlotWorld class for that world ! will return null if not a plot world world

    - #### getWorldSettings

          public PlotWorld getWorldSettings(java.lang.String world)

      Get the settings for a world (settings bundled in PlotWorld class)
      Parameters:
        `world` - (to get settings of)
      Returns:
        PlotWorld class for that world ! will return null if not a plot world world

    - #### sendMessage

          public void sendMessage(org.bukkit.entity.Player player,
                         C c)

      Send a message to a player.
      Parameters:
        `player` -
        `c` - (Caption)

    - #### sendMessage

          public void sendMessage(org.bukkit.entity.Player player,
                         java.lang.String string)

      Send a message to a player. - Supports color codes
      Parameters:
        `player` -
        `string` -

    - #### sendConsoleMessage

          public void sendConsoleMessage(java.lang.String msg)

      Send a message to the console. - Supports color codes
      Parameters:
        `msg` -

    - #### sendConsoleMessage

          public void sendConsoleMessage(C c)

      Send a message to the console
      Parameters:
        `c` - (Caption)

    - #### addFlag

          public void addFlag(AbstractFlag flag)

      Register a flag for use in plots
      Parameters:
        `flag` -

    - #### getFlags

          public AbstractFlag[] getFlags()

      get all the currently registered flags
      Returns:
        array of Flag[]

    - #### getPlot

          public Plot getPlot(org.bukkit.World world,
                     int x,
                     int z)

      Get a plot based on the ID
      Parameters:
        `world` -
        `x` -
        `z` -
      Returns:
        plot, null if ID is wrong

    - #### getPlot

          public Plot getPlot(org.bukkit.Location l)

      Get a plot based on the location
      Parameters:
        `l` -
      Returns:
        plot if found, otherwise it creates a temporary plot-

    - #### getPlot

          public Plot getPlot(org.bukkit.entity.Player player)

      Get a plot based on the player location
      Parameters:
        `player` -
      Returns:
        plot if found, otherwise it creates a temporary plot

    - #### hasPlot

          public boolean hasPlot(org.bukkit.World world,
                        org.bukkit.entity.Player player)

      Check whether or not a player has a plot
      Parameters:
        `player` -
      Returns:
        true if player has a plot, false if not.

    - #### getPlots

          public Plot[] getPlots(org.bukkit.World world,
                        org.bukkit.entity.Player plr,
                        boolean just_owner)

      Get all plots for the player
      Parameters:
        `plr` - to search for
        `just_owner` - should we just search for owner? Or with rights?

    - #### getPlots

          public Plot[] getPlots(org.bukkit.World world)

      Get all plots for the world
      Parameters:
        `world` - to get plots of
      Returns:
        Plot[] - array of plot objects in world

    - #### getPlotWorlds

          public java.lang.String[] getPlotWorlds()

      Get all plot worlds
      Returns:
        World[] - array of plot worlds

    - #### isPlotWorld

          public boolean isPlotWorld(org.bukkit.World world)

      Get if plot world
      Parameters:
        `world` - (to check if plot world)
      Returns:
        boolean (if plot world or not)

    - #### getLocations

          public org.bukkit.Location[] getLocations(Plot p)

      Get plot locations
      Parameters:
        `p` -
      Returns:
        [0] = bottomLc, [1] = topLoc, [2] = home

    - #### getHomeLocation

          public org.bukkit.Location getHomeLocation(Plot p)

      Get home location
      Parameters:
        `p` -
      Returns:
        plot bottom location

    - #### getBottomLocation

          public org.bukkit.Location getBottomLocation(Plot p)

      Get Bottom Location
      Parameters:
        `p` -
      Returns:
        plot bottom location

    - #### getTopLocation

          public org.bukkit.Location getTopLocation(Plot p)

      Get Top Location
      Parameters:
        `p` -
      Returns:
        plot top location

    - #### isInPlot

          public boolean isInPlot(org.bukkit.entity.Player player)

      Check whether or not a player is in a plot
      Parameters:
        `player` -
      Returns:
        true if the player is in a plot, false if not-

    - #### registerCommand

          public void registerCommand(SubCommand c)

      Register a subcommand
      Parameters:
        `c` -

    - #### getPlotMain

          public PlotMain getPlotMain()

      Get the plotMain class
      Returns:
        PlotMain Class

    - #### getPlayerPlotCount

          public int getPlayerPlotCount(org.bukkit.World world,
                               org.bukkit.entity.Player player)

      Get the player plot count
      Parameters:
        `player` -
      Returns:

    - #### getPlayerPlots

          public java.util.Set<Plot> getPlayerPlots(org.bukkit.World world,
                                           org.bukkit.entity.Player player)

      Get a players plots
      Parameters:
        `player` -
      Returns:
        a set containing the players plots

    - #### getAllowedPlots

          public int getAllowedPlots(org.bukkit.entity.Player player)

      Get the allowed plot count for a player
      Parameters:
        `player` -
      Returns:
        the number of allowed plots