com.intellectualcrafters.plot

## Class PlotMain

- java.lang.Object
- - org.bukkit.plugin.PluginBase
  - - org.bukkit.plugin.java.JavaPlugin
    - - com.intellectualcrafters.plot.PlotMain

- All Implemented Interfaces:
    org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

      public class PlotMain
      extends org.bukkit.plugin.java.JavaPlugin

  PlotMain class.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ADMIN_PERMISSION`
    `static me.confuser.barapi.BarAPI` | `barAPI` BarAPI object
    `static java.util.HashMap<org.bukkit.Material,java.lang.String>` | `booleanFlags` Boolean Flags (material)
    `static org.bukkit.configuration.file.YamlConfiguration` | `config` The main configuration file
    `static java.io.File` | `configFile` settings.properties
    `static java.sql.Connection` | `connection` MySQL Connection
    `static net.milkbowl.vault.economy.Economy` | `economy` Economy Object (vault)
    `static org.bukkit.configuration.file.YamlConfiguration` | `storage` Contains storage options
    `static int` | `storage_ver` Storage version
    `static java.io.File` | `storageFile` storage.properties
    `static boolean` | `useEconomy` Use Economy?
    `static com.sk89q.worldedit.bukkit.WorldEditPlugin` | `worldEdit` WorldEdit object
    `static com.sk89q.worldguard.bukkit.WorldGuardPlugin` | `worldGuard` World Guard Object
    `static WorldGuardListener` | `worldGuardListener` World Guard Listener

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlotMain()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addPlotWorld(java.lang.String world, PlotWorld plotworld, PlotManager manager)`
    `static void` | `Broadcast(C c)` Broadcast publicly
    `static void` | `BroadcastWithPerms(C c)` Broadcast a message to all admins
    `static void` | `checkForExpiredPlots()` Check for expired plots
    `static void` | `configs()` Load configuration files
    `static void` | `createConfiguration(PlotWorld plotworld)`
    `static java.util.HashMap<java.lang.String,java.util.HashMap<PlotId,Plot>>` | `getAllPlotsRaw()`
    `static java.sql.Connection` | `getConnection()` Get MySQL Connection
    `org.bukkit.generator.ChunkGenerator` | `getDefaultWorldGenerator(java.lang.String world, java.lang.String id)` !!
    `static long` | `getLastPlayed(java.util.UUID uuid)`
    `static PlotMain` | `getMain()` Returns the main class.
    `static PlotManager` | `getPlotManager(java.lang.String world)`
    `static PlotManager` | `getPlotManager(org.bukkit.World world)`
    `static java.util.Set<Plot>` | `getPlots()` Get all plots
    `static java.util.Set<Plot>` | `getPlots(org.bukkit.entity.Player player)`
    `static java.util.HashMap<PlotId,Plot>` | `getPlots(java.lang.String world)`
    `static java.util.HashMap<PlotId,Plot>` | `getPlots(org.bukkit.World world)`
    `static java.util.Set<Plot>` | `getPlots(org.bukkit.World world, org.bukkit.entity.Player player)`
    `static java.util.LinkedHashSet<Plot>` | `getPlotsSorted()` Get a sorted list of plots
    `static java.lang.String[]` | `getPlotWorlds()` get all plot worlds
    `static java.lang.String[]` | `getPlotWorldsString()`
    `static UUIDSaver` | `getUUIDSaver()` Get the uuid saver
    `static Plot[]` | `getWorldPlots(org.bukkit.World world)`
    `static PlotWorld` | `getWorldSettings(java.lang.String world)`
    `static PlotWorld` | `getWorldSettings(org.bukkit.World world)`
    `static boolean` | `hasPermission(org.bukkit.entity.Player player, java.lang.String perm)` Check a player for a permission - Op has all permissions - checks for '*' nodes
    `static int` | `hasPermissionRange(org.bukkit.entity.Player player, java.lang.String stub, int range)` Check a range of permissions e.g.
    `static boolean` | `hasPermissions(org.bukkit.entity.Player player, java.lang.String[] perms)` Check a player for a permission - Op has all permissions - checks for '*' nodes
    `static boolean` | `isPlotWorld(java.lang.String world)`
    `static boolean` | `isPlotWorld(org.bukkit.World world)`
    `static void` | `killAllEntities()` Kill all entities on roads
    `static void` | `loadWorld(java.lang.String world, org.bukkit.generator.ChunkGenerator generator)`
    `static void` | `loadWorld(org.bukkit.World world)` Adds an external world as a recognized PlotSquared world - The PlotWorld class created is based off the configuration in the settings.yml - Do not use this method unless the required world is preconfigured in the settings.yml
    `void` | `onDisable()` On unload
    `void` | `onEnable()` On Load.
    `static void` | `reloadTranslations()`
    `static boolean` | `removePlot(java.lang.String world, PlotId id, boolean callEvent)`
    `static void` | `removePlotWorld(java.lang.String world)`
    `static void` | `sendConsoleSenderMessage(C c)` Send a message to the console
    `static void` | `sendConsoleSenderMessage(java.lang.String string)` Send a message to the console.
    `static void` | `setAllPlotsRaw(java.util.HashMap<java.lang.String,java.util.HashMap<PlotId,Plot>> plots)`
    `static void` | `setAllPlotsRaw(java.util.LinkedHashMap<java.lang.String,java.util.HashMap<PlotId,Plot>> plots)`
    `static void` | `setUUIDSaver(UUIDSaver saver)` Set the uuid saver
    `static boolean` | `teleportPlayer(org.bukkit.entity.Player player, org.bukkit.Location from, Plot plot)` ..
    `static void` | `updatePlot(Plot plot)` Replace the plot object with an updated version

    - ### Methods inherited from class org.bukkit.plugin.java.JavaPlugin

      `getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, initialize, installDDL, isEnabled, isInitialized, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString`

    - ### Methods inherited from class org.bukkit.plugin.PluginBase

      `equals, getName, hashCode`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ADMIN_PERMISSION

          public static final java.lang.String ADMIN_PERMISSION

      See Also:
        Constant Field Values

    - #### configFile

          public static java.io.File configFile

      settings.properties

    - #### config

          public static org.bukkit.configuration.file.YamlConfiguration config

      The main configuration file

    - #### storageFile

          public static java.io.File storageFile

      storage.properties

    - #### storage

          public static org.bukkit.configuration.file.YamlConfiguration storage

      Contains storage options

    - #### storage_ver

          public static int storage_ver

      Storage version

    - #### connection

          public static java.sql.Connection connection

      MySQL Connection

    - #### worldEdit

          public static com.sk89q.worldedit.bukkit.WorldEditPlugin worldEdit

      WorldEdit object

    - #### barAPI

          public static me.confuser.barapi.BarAPI barAPI

      BarAPI object

    - #### worldGuard

          public static com.sk89q.worldguard.bukkit.WorldGuardPlugin worldGuard

      World Guard Object

    - #### worldGuardListener

          public static WorldGuardListener worldGuardListener

      World Guard Listener

    - #### economy

          public static net.milkbowl.vault.economy.Economy economy

      Economy Object (vault)

    - #### useEconomy

          public static boolean useEconomy

      Use Economy?

    - #### booleanFlags

          public static java.util.HashMap<org.bukkit.Material,java.lang.String> booleanFlags

      Boolean Flags (material)

  - ### Constructor Detail

    - #### PlotMain

          public PlotMain()

  - ### Method Detail

    - #### checkForExpiredPlots

          public static void checkForExpiredPlots()

      Check for expired plots

    - #### hasPermissionRange

          public static int hasPermissionRange(org.bukkit.entity.Player player,
                               java.lang.String stub,
                               int range)

      Check a range of permissions e.g. 'plots.plot.<0-100>'
      Returns highest integer in range.
      Parameters:
        `player` - to check
        `stub` - to check
        `range` - tp check
      Returns:
        permitted range

    - #### hasPermissions

          public static boolean hasPermissions(org.bukkit.entity.Player player,
                               java.lang.String[] perms)

      Check a player for a permission
      - Op has all permissions
      - checks for '*' nodes
      Parameters:
        `player` - to check
        `perms` - to check
      Returns:
        true of player has permissions

    - #### getUUIDSaver

          public static UUIDSaver getUUIDSaver()

      Get the uuid saver
      Returns:
        uuid saver
      See Also:
        `com.intellectualcrafters.plot.uuid.UUIDSaver;`

    - #### setUUIDSaver

          public static void setUUIDSaver(UUIDSaver saver)

      Set the uuid saver
      Parameters:
        `saver` - new saver

    - #### hasPermission

          public static boolean hasPermission(org.bukkit.entity.Player player,
                              java.lang.String perm)

      Check a player for a permission
      - Op has all permissions
      - checks for '*' nodes
      Parameters:
        `player` - to check
        `perm` - to check
      Returns:
        true if player has the permission

    - #### getPlots

          public static java.util.Set<Plot> getPlots()

      Get all plots
      Returns:
        HashMap containing the plot ID and the plot object.

    - #### getPlotsSorted

          public static java.util.LinkedHashSet<Plot> getPlotsSorted()

      Get a sorted list of plots
      Returns:
        sorted list

    - #### getPlots

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

      Parameters:
        `player` - player
      Returns:
        Set Containing the players plots

    - #### getPlots

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

      Parameters:
        `world` - plot world
        `player` - plot owner
      Returns:
        players plots

    - #### getPlots

          public static java.util.HashMap<PlotId,Plot> getPlots(java.lang.String world)

    - #### getPlots

          public static java.util.HashMap<PlotId,Plot> getPlots(org.bukkit.World world)

      Parameters:
        `world` - plot world
      Returns:
        plots in world

    - #### getPlotWorlds

          public static java.lang.String[] getPlotWorlds()

      get all plot worlds

    - #### getPlotWorldsString

          public static java.lang.String[] getPlotWorldsString()

      Returns:
        plots worlds

    - #### isPlotWorld

          public static boolean isPlotWorld(org.bukkit.World world)

      Parameters:
        `world` - plotworld(?)
      Returns:
        true if the world is a plotworld

    - #### isPlotWorld

          public static boolean isPlotWorld(java.lang.String world)

      Parameters:
        `world` - plotworld(?)
      Returns:
        true if the world is a plotworld

    - #### getPlotManager

          public static PlotManager getPlotManager(org.bukkit.World world)

      Parameters:
        `world` - World to get manager for
      Returns:
        manager for world

    - #### getPlotManager

          public static PlotManager getPlotManager(java.lang.String world)

      Parameters:
        `world` - world
      Returns:
        PlotManager

    - #### getWorldSettings

          public static PlotWorld getWorldSettings(org.bukkit.World world)

      Parameters:
        `world` - to search
      Returns:
        PlotWorld object

    - #### getWorldSettings

          public static PlotWorld getWorldSettings(java.lang.String world)

      Parameters:
        `world` - to search
      Returns:
        PlotWorld object

    - #### getWorldPlots

          public static Plot[] getWorldPlots(org.bukkit.World world)

      Parameters:
        `world` - world to search
      Returns:
        set containing the plots for a world

    - #### removePlot

          public static boolean removePlot(java.lang.String world,
                           PlotId id,
                           boolean callEvent)

    - #### updatePlot

          public static void updatePlot(Plot plot)

      Replace the plot object with an updated version
      Parameters:
        `plot` - plot object

    - #### getConnection

          public static java.sql.Connection getConnection()

      Get MySQL Connection
      Returns:
        connection MySQL Connection.

    - #### sendConsoleSenderMessage

          public static void sendConsoleSenderMessage(java.lang.String string)

      Send a message to the console.
      Parameters:
        `string` - message

    - #### teleportPlayer

          public static boolean teleportPlayer(org.bukkit.entity.Player player,
                               org.bukkit.Location from,
                               Plot plot)

      ..

    - #### sendConsoleSenderMessage

          public static void sendConsoleSenderMessage(C c)

      Send a message to the console
      Parameters:
        `c` - message

    - #### Broadcast

          public static void Broadcast(C c)

      Broadcast publicly
      Parameters:
        `c` - message

    - #### getMain

          public static PlotMain getMain()

      Returns the main class.
      Returns:
        (this class)

    - #### BroadcastWithPerms

          public static void BroadcastWithPerms(C c)

      Broadcast a message to all admins
      Parameters:
        `c` - message

    - #### reloadTranslations

          public static void reloadTranslations()
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getLastPlayed

          public static long getLastPlayed(java.util.UUID uuid)

    - #### configs

          public static void configs()

      Load configuration files

    - #### killAllEntities

          public static void killAllEntities()

      Kill all entities on roads

    - #### createConfiguration

          public static void createConfiguration(PlotWorld plotworld)

    - #### loadWorld

          public static void loadWorld(java.lang.String world,
                       org.bukkit.generator.ChunkGenerator generator)

    - #### loadWorld

          public static void loadWorld(org.bukkit.World world)

      Adds an external world as a recognized PlotSquared world - The PlotWorld class created is based off the configuration in the settings.yml - Do not use this method unless the required world is preconfigured in the settings.yml
      Parameters:
        `world` - to load

    - #### addPlotWorld

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

    - #### removePlotWorld

          public static void removePlotWorld(java.lang.String world)

    - #### getAllPlotsRaw

          public static java.util.HashMap<java.lang.String,java.util.HashMap<PlotId,Plot>> getAllPlotsRaw()

    - #### setAllPlotsRaw

          public static void setAllPlotsRaw(java.util.LinkedHashMap<java.lang.String,java.util.HashMap<PlotId,Plot>> plots)

    - #### setAllPlotsRaw

          public static void setAllPlotsRaw(java.util.HashMap<java.lang.String,java.util.HashMap<PlotId,Plot>> plots)

    - #### getDefaultWorldGenerator

          public org.bukkit.generator.ChunkGenerator getDefaultWorldGenerator(java.lang.String world,
                                                                     java.lang.String id)

      !!WorldGeneration!!
      Specified by:
        `getDefaultWorldGenerator` in interface `org.bukkit.plugin.Plugin`
      Overrides:
        `getDefaultWorldGenerator` in class `org.bukkit.plugin.java.JavaPlugin`

    - #### onEnable

          public void onEnable()

      On Load.
      Specified by:
        `onEnable` in interface `org.bukkit.plugin.Plugin`
      Overrides:
        `onEnable` in class `org.bukkit.plugin.java.JavaPlugin`

    - #### onDisable

          public void onDisable()

      On unload
      Specified by:
        `onDisable` in interface `org.bukkit.plugin.Plugin`
      Overrides:
        `onDisable` in class `org.bukkit.plugin.java.JavaPlugin`