com.intellectualcrafters.plot.util

## Class PlotHelper

- java.lang.Object
- - com.intellectualcrafters.plot.util.PlotHelper

-     public class PlotHelper
      extends java.lang.Object

  plot functions

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `canSetFast`
    `static java.util.HashMap<Plot,java.lang.Integer>` | `runners`
    `static java.util.ArrayList<java.lang.String>` | `runners_p`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlotHelper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `adjustWall(org.bukkit.entity.Player player, Plot plot, PlotBlock block)` Adjusts a plot wall
    `static void` | `adjustWallFilling(org.bukkit.entity.Player requester, Plot plot, PlotBlock block)`
    `static void` | `autoMerge(org.bukkit.World world, Plot plot, org.bukkit.entity.Player player)`
    `static void` | `clear(org.bukkit.entity.Player requester, Plot plot)` Clear a plot
    `static void` | `clear(org.bukkit.World world, Plot plot)`
    `static void` | `clearAllEntities(org.bukkit.World world, Plot plot, boolean tile)`
    `static java.lang.String` | `createId(int x, int z)`
    `static boolean` | `createPlot(org.bukkit.entity.Player player, Plot plot)`
    `static short[]` | `getBlock(java.lang.String block)`
    `static Plot` | `getCurrentPlot(org.bukkit.Location loc)` Returns the plot at a given location
    `static int` | `getEntities(org.bukkit.World world)`
    `static int` | `getHeighestBlock(org.bukkit.World world, int x, int z)`
    `static int` | `getLoadedChunks(org.bukkit.World world)`
    `static java.lang.String` | `getPlayerName(java.util.UUID uuid)`
    `static Plot` | `getPlot(org.bukkit.World world, PlotId id)` Fetches the plot from the main class
    `static org.bukkit.Location` | `getPlotBottomLoc(org.bukkit.World world, PlotId id)` Gets the bottom loc of a plot (if mega, returns bottom loc of that mega plot) - If you would like each plot treated as a small plot use getPlotBottomLocAbs(...)
    `static org.bukkit.Location` | `getPlotBottomLocAbs(org.bukkit.World world, PlotId id)` Gets the bottom plot location of a plot (all plots are treated as small plots) - To get the top loc of a mega plot use getPlotBottomLoc(...)
    `static org.bukkit.Location` | `getPlotHome(org.bukkit.World w, Plot plot)`
    `static org.bukkit.Location` | `getPlotHome(org.bukkit.World w, PlotId plotid)`
    `static PlotId` | `getPlotIdRelative(PlotId id, int direction)` direction 0 = north, 1 = south, etc:
    `static org.bukkit.Location` | `getPlotTopLoc(org.bukkit.World world, PlotId id)` Gets the top loc of a plot (if mega, returns top loc of that mega plot) - If you would like each plot treated as a small plot use getPlotTopLocAbs(...)
    `static org.bukkit.Location` | `getPlotTopLocAbs(org.bukkit.World world, PlotId id)` Gets the top plot location of a plot (all plots are treated as small plots) - To get the top loc of a mega plot use getPlotTopLoc(...)
    `static int` | `getPlotWidth(org.bukkit.World world, PlotId id)` Obtains the width of a plot (x width)
    `static java.lang.String` | `getStringSized(int max, java.lang.String string)`
    `static int` | `getTileEntities(org.bukkit.World world)`
    `static double` | `getWorldFolderSize(org.bukkit.World world)`
    `static void` | `mergePlot(org.bukkit.World world, Plot lesserPlot, Plot greaterPlot)` Merges 2 plots Removes the road inbetween - Assumes the first plot parameter is lower - Assumes neither are a Mega-plot - Assumes plots are directly next to each other - Saves to DB
    `static boolean` | `mergePlots(org.bukkit.entity.Player plr, org.bukkit.World world, java.util.ArrayList<PlotId> plotIds)` Merges all plots in the arraylist (with cost)
    `static boolean` | `mergePlots(org.bukkit.World world, java.util.ArrayList<PlotId> plotIds)` Completely merges a set of plots (There are no checks to make sure you supply the correct arguments) - Misuse of this method can result in unusable plots - the set of plots must belong to one owner and be rectangular - the plot array must be sorted in ascending order - Road will be removed where required - changes will be saved to DB
    `static long` | `nextLong()`
    `static int` | `random(int n)`
    `static void` | `refreshPlotChunks(org.bukkit.World world, Plot plot)`
    `static void` | `removeSign(org.bukkit.World world, Plot p)`
    `static void` | `setBiome(org.bukkit.World world, Plot plot, org.bukkit.block.Biome b)`
    `static boolean` | `setBlock(org.bukkit.block.Block block, PlotBlock plotblock)` Set a block quickly, attempts to use NMS if possible
    `static void` | `setCuboid(org.bukkit.World world, org.bukkit.Location pos1, org.bukkit.Location pos2, PlotBlock[] blocks)`
    `static void` | `setFloor(org.bukkit.entity.Player requester, Plot plot, PlotBlock[] blocks)`
    `static void` | `setSign(org.bukkit.entity.Player player, Plot p)`
    `static void` | `setSign(org.bukkit.World world, java.lang.String name, Plot p)`
    `static void` | `setSimpleCuboid(org.bukkit.World world, org.bukkit.Location pos1, org.bukkit.Location pos2, PlotBlock newblock)`
    `static int` | `square(int x)`
    `static long` | `xorShift64(long a)`

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

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

- - ### Field Detail

    - #### canSetFast

          public static boolean canSetFast

    - #### runners_p

          public static java.util.ArrayList<java.lang.String> runners_p

    - #### runners

          public static java.util.HashMap<Plot,java.lang.Integer> runners

  - ### Constructor Detail

    - #### PlotHelper

          public PlotHelper()

  - ### Method Detail

    - #### getPlotIdRelative

          public static PlotId getPlotIdRelative(PlotId id,
                                 int direction)

      direction 0 = north, 1 = south, etc:
      Parameters:
        `id` -
        `direction` -
      Returns:

    - #### mergePlots

          public static boolean mergePlots(org.bukkit.entity.Player plr,
                           org.bukkit.World world,
                           java.util.ArrayList<PlotId> plotIds)

      Merges all plots in the arraylist (with cost)
      Parameters:
        `plr` -
        `world` -
        `plotIds` -
      Returns:

    - #### mergePlots

          public static boolean mergePlots(org.bukkit.World world,
                           java.util.ArrayList<PlotId> plotIds)

      Completely merges a set of plots
      (There are no checks to make sure you supply the correct arguments)
      - Misuse of this method can result in unusable plots
      - the set of plots must belong to one owner and be rectangular
      - the plot array must be sorted in ascending order
      - Road will be removed where required
      - changes will be saved to DB
      Parameters:
        `world` -
        `plotIds` -
      Returns:
        boolean (success)

    - #### mergePlot

          public static void mergePlot(org.bukkit.World world,
                       Plot lesserPlot,
                       Plot greaterPlot)

      Merges 2 plots Removes the road inbetween
      - Assumes the first plot parameter is lower
      - Assumes neither are a Mega-plot
      - Assumes plots are directly next to each other
      - Saves to DB
      Parameters:
        `world` -
        `lesserPlot` -
        `greaterPlot` -

    - #### nextLong

          public static final long nextLong()

    - #### xorShift64

          public static final long xorShift64(long a)

    - #### random

          public static final int random(int n)

    - #### removeSign

          public static void removeSign(org.bukkit.World world,
                        Plot p)

    - #### setSign

          public static void setSign(org.bukkit.entity.Player player,
                     Plot p)

    - #### setSign

          public static void setSign(org.bukkit.World world,
                     java.lang.String name,
                     Plot p)

    - #### getPlayerName

          public static java.lang.String getPlayerName(java.util.UUID uuid)

    - #### getStringSized

          public static java.lang.String getStringSized(int max,
                                        java.lang.String string)

    - #### setBlock

          public static boolean setBlock(org.bukkit.block.Block block,
                         PlotBlock plotblock)

      Set a block quickly, attempts to use NMS if possible
      Parameters:
        `block` -
        `plotblock` -

    - #### adjustWall

          public static void adjustWall(org.bukkit.entity.Player player,
                        Plot plot,
                        PlotBlock block)

      Adjusts a plot wall
      Parameters:
        `player` -
        `plot` -
        `block` -

    - #### autoMerge

          public static void autoMerge(org.bukkit.World world,
                       Plot plot,
                       org.bukkit.entity.Player player)

    - #### createPlot

          public static boolean createPlot(org.bukkit.entity.Player player,
                           Plot plot)

    - #### getLoadedChunks

          public static int getLoadedChunks(org.bukkit.World world)

    - #### getEntities

          public static int getEntities(org.bukkit.World world)

    - #### getTileEntities

          public static int getTileEntities(org.bukkit.World world)

    - #### getWorldFolderSize

          public static double getWorldFolderSize(org.bukkit.World world)

    - #### createId

          public static java.lang.String createId(int x,
                                  int z)

    - #### adjustWallFilling

          public static void adjustWallFilling(org.bukkit.entity.Player requester,
                               Plot plot,
                               PlotBlock block)

    - #### setFloor

          public static void setFloor(org.bukkit.entity.Player requester,
                      Plot plot,
                      PlotBlock[] blocks)

    - #### square

          public static int square(int x)

    - #### getBlock

          public static short[] getBlock(java.lang.String block)

    - #### clearAllEntities

          public static void clearAllEntities(org.bukkit.World world,
                              Plot plot,
                              boolean tile)

    - #### clear

          public static void clear(org.bukkit.World world,
                   Plot plot)

    - #### clear

          public static void clear(org.bukkit.entity.Player requester,
                   Plot plot)

      Clear a plot
      Parameters:
        `requester` -
        `plot` -

    - #### setCuboid

          public static void setCuboid(org.bukkit.World world,
                       org.bukkit.Location pos1,
                       org.bukkit.Location pos2,
                       PlotBlock[] blocks)

    - #### setSimpleCuboid

          public static void setSimpleCuboid(org.bukkit.World world,
                             org.bukkit.Location pos1,
                             org.bukkit.Location pos2,
                             PlotBlock newblock)

    - #### setBiome

          public static void setBiome(org.bukkit.World world,
                      Plot plot,
                      org.bukkit.block.Biome b)

    - #### getHeighestBlock

          public static int getHeighestBlock(org.bukkit.World world,
                             int x,
                             int z)

    - #### getPlotHome

          public static org.bukkit.Location getPlotHome(org.bukkit.World w,
                                        PlotId plotid)

    - #### getPlotHome

          public static org.bukkit.Location getPlotHome(org.bukkit.World w,
                                        Plot plot)

    - #### refreshPlotChunks

          public static void refreshPlotChunks(org.bukkit.World world,
                               Plot plot)

    - #### getPlotTopLocAbs

          public static org.bukkit.Location getPlotTopLocAbs(org.bukkit.World world,
                                             PlotId id)

      Gets the top plot location of a plot (all plots are treated as small plots) - To get the top loc of a mega plot use getPlotTopLoc(...)
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getPlotBottomLocAbs

          public static org.bukkit.Location getPlotBottomLocAbs(org.bukkit.World world,
                                                PlotId id)

      Gets the bottom plot location of a plot (all plots are treated as small plots) - To get the top loc of a mega plot use getPlotBottomLoc(...)
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getPlotWidth

          public static int getPlotWidth(org.bukkit.World world,
                         PlotId id)

      Obtains the width of a plot (x width)
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getPlotTopLoc

          public static org.bukkit.Location getPlotTopLoc(org.bukkit.World world,
                                          PlotId id)

      Gets the top loc of a plot (if mega, returns top loc of that mega plot) - If you would like each plot treated as a small plot use getPlotTopLocAbs(...)
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getPlotBottomLoc

          public static org.bukkit.Location getPlotBottomLoc(org.bukkit.World world,
                                             PlotId id)

      Gets the bottom loc of a plot (if mega, returns bottom loc of that mega plot) - If you would like each plot treated as a small plot use getPlotBottomLocAbs(...)
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getPlot

          public static Plot getPlot(org.bukkit.World world,
                     PlotId id)

      Fetches the plot from the main class
      Parameters:
        `world` -
        `id` -
      Returns:

    - #### getCurrentPlot

          public static Plot getCurrentPlot(org.bukkit.Location loc)

      Returns the plot at a given location
      Parameters:
        `loc` -
      Returns: