com.intellectualcrafters.plot.generator

## Class DefaultPlotManager

- java.lang.Object
- - com.intellectualcrafters.plot.object.PlotManager
  - - com.intellectualcrafters.plot.generator.DefaultPlotManager

-     public class DefaultPlotManager
      extends PlotManager

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPlotManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `clearPlot(org.bukkit.World world, Plot plot)` Clearing the plot needs to only consider removing the blocks - This implementation has used the SetCuboid function, as it is fast, and uses NMS code - It also makes use of the fact that deleting chunks is a lot faster than block updates This code is very messy, but you don't need to do something quite as complex unless you happen to have 512x512 sized plots
    `boolean` | `createRoadEast(PlotWorld plotworld, Plot plot)` PLOT MERGING
    `boolean` | `createRoadSouth(PlotWorld plotworld, Plot plot)`
    `boolean` | `createRoadSouthEast(PlotWorld plotworld, Plot plot)`
    `boolean` | `finishPlotMerge(org.bukkit.World world, PlotWorld plotworld, java.util.ArrayList<PlotId> plotIds)` Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED)
    `boolean` | `finishPlotUnlink(org.bukkit.World world, PlotWorld plotworld, java.util.ArrayList<PlotId> plotIds)`
    `org.bukkit.Location` | `getPlotBottomLocAbs(PlotWorld plotworld, PlotId plotid)` Get the bottom plot loc (some basic math)
    `PlotId` | `getPlotId(PlotWorld plotworld, org.bukkit.Location loc)` Some complex stuff for traversing mega plots (return getPlotIdAbs if you do not support mega plots)
    `PlotId` | `getPlotIdAbs(PlotWorld plotworld, org.bukkit.Location loc)` Default implementation of getting a plot at a given location For a simplified explanation of the math involved: - Get the current coords - shift these numbers down to something relatable for a single plot (similar to reducing trigonometric functions down to the first quadrant) - e.g.
    `org.bukkit.Location` | `getPlotTopLocAbs(PlotWorld plotworld, PlotId plotid)` Get the top plot loc (some basic math)
    `org.bukkit.Location` | `getSignLoc(org.bukkit.World world, PlotWorld plotworld, Plot plot)` Remove sign for a plot
    `boolean` | `isInPlotAbs(PlotWorld plotworld, org.bukkit.Location loc, PlotId plotid)` Check if a location is inside a specific plot(non-Javadoc) - For this implementation, we don't need to do anything fancier than referring to getPlotIdAbs(...)
    `boolean` | `removeRoadEast(PlotWorld plotworld, Plot plot)`
    `boolean` | `removeRoadSouth(PlotWorld plotworld, Plot plot)`
    `boolean` | `removeRoadSouthEast(PlotWorld plotworld, Plot plot)`
    `boolean` | `setBiome(org.bukkit.World world, Plot plot, org.bukkit.block.Biome biome)` Set a plot biome
    `boolean` | `setFloor(org.bukkit.World world, PlotWorld plotworld, PlotId plotid, PlotBlock[] blocks)`
    `boolean` | `setWall(org.bukkit.World w, PlotWorld plotworld, PlotId plotid, PlotBlock plotblock)`
    `boolean` | `setWallFilling(org.bukkit.World w, PlotWorld plotworld, PlotId plotid, PlotBlock plotblock)`
    `boolean` | `startPlotMerge(org.bukkit.World world, PlotWorld plotworld, java.util.ArrayList<PlotId> plotIds)`
    `boolean` | `startPlotUnlink(org.bukkit.World world, PlotWorld plotworld, java.util.ArrayList<PlotId> plotIds)`

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

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

- - ### Constructor Detail

    - #### DefaultPlotManager

          public DefaultPlotManager()

  - ### Method Detail

    - #### getPlotIdAbs

          public PlotId getPlotIdAbs(PlotWorld plotworld,
                            org.bukkit.Location loc)

      Default implementation of getting a plot at a given location For a simplified explanation of the math involved: - Get the current coords - shift these numbers down to something relatable for a single plot (similar to reducing trigonometric functions down to the first quadrant) - e.g. If the plot size is 20 blocks, and we are at x=25, it's equivalent to x=5 for that specific plot From this, and knowing how thick the road is, we can say whether x=5 is road, or plot. The number of shifts done, is also counted, and this number gives us the PlotId
      Specified by:
        `getPlotIdAbs` in class `PlotManager`

    - #### getPlotId

          public PlotId getPlotId(PlotWorld plotworld,
                         org.bukkit.Location loc)

      Some complex stuff for traversing mega plots (return getPlotIdAbs if you do not support mega plots)
      Specified by:
        `getPlotId` in class `PlotManager`

    - #### isInPlotAbs

          public boolean isInPlotAbs(PlotWorld plotworld,
                            org.bukkit.Location loc,
                            PlotId plotid)

      Check if a location is inside a specific plot(non-Javadoc) - For this implementation, we don't need to do anything fancier than referring to getPlotIdAbs(...)
      Specified by:
        `isInPlotAbs` in class `PlotManager`

    - #### getPlotBottomLocAbs

          public org.bukkit.Location getPlotBottomLocAbs(PlotWorld plotworld,
                                                PlotId plotid)

      Get the bottom plot loc (some basic math)
      Specified by:
        `getPlotBottomLocAbs` in class `PlotManager`

    - #### getPlotTopLocAbs

          public org.bukkit.Location getPlotTopLocAbs(PlotWorld plotworld,
                                             PlotId plotid)

      Get the top plot loc (some basic math)
      Specified by:
        `getPlotTopLocAbs` in class `PlotManager`

    - #### clearPlot

          public boolean clearPlot(org.bukkit.World world,
                          Plot plot)

      Clearing the plot needs to only consider removing the blocks - This implementation has used the SetCuboid function, as it is fast, and uses NMS code - It also makes use of the fact that deleting chunks is a lot faster than block updates This code is very messy, but you don't need to do something quite as complex unless you happen to have 512x512 sized plots
      Specified by:
        `clearPlot` in class `PlotManager`

    - #### getSignLoc

          public org.bukkit.Location getSignLoc(org.bukkit.World world,
                                       PlotWorld plotworld,
                                       Plot plot)

      Remove sign for a plot
      Specified by:
        `getSignLoc` in class `PlotManager`

    - #### setFloor

          public boolean setFloor(org.bukkit.World world,
                         PlotWorld plotworld,
                         PlotId plotid,
                         PlotBlock[] blocks)

      Specified by:
        `setFloor` in class `PlotManager`

    - #### setWallFilling

          public boolean setWallFilling(org.bukkit.World w,
                               PlotWorld plotworld,
                               PlotId plotid,
                               PlotBlock plotblock)

      Specified by:
        `setWallFilling` in class `PlotManager`

    - #### setWall

          public boolean setWall(org.bukkit.World w,
                        PlotWorld plotworld,
                        PlotId plotid,
                        PlotBlock plotblock)

      Specified by:
        `setWall` in class `PlotManager`

    - #### setBiome

          public boolean setBiome(org.bukkit.World world,
                         Plot plot,
                         org.bukkit.block.Biome biome)

      Set a plot biome
      Specified by:
        `setBiome` in class `PlotManager`

    - #### createRoadEast

          public boolean createRoadEast(PlotWorld plotworld,
                               Plot plot)

      PLOT MERGING
      Specified by:
        `createRoadEast` in class `PlotManager`

    - #### createRoadSouth

          public boolean createRoadSouth(PlotWorld plotworld,
                                Plot plot)

      Specified by:
        `createRoadSouth` in class `PlotManager`

    - #### createRoadSouthEast

          public boolean createRoadSouthEast(PlotWorld plotworld,
                                    Plot plot)

      Specified by:
        `createRoadSouthEast` in class `PlotManager`

    - #### removeRoadEast

          public boolean removeRoadEast(PlotWorld plotworld,
                               Plot plot)

      Specified by:
        `removeRoadEast` in class `PlotManager`

    - #### removeRoadSouth

          public boolean removeRoadSouth(PlotWorld plotworld,
                                Plot plot)

      Specified by:
        `removeRoadSouth` in class `PlotManager`

    - #### removeRoadSouthEast

          public boolean removeRoadSouthEast(PlotWorld plotworld,
                                    Plot plot)

      Specified by:
        `removeRoadSouthEast` in class `PlotManager`

    - #### finishPlotMerge

          public boolean finishPlotMerge(org.bukkit.World world,
                                PlotWorld plotworld,
                                java.util.ArrayList<PlotId> plotIds)

      Finishing off plot merging by adding in the walls surrounding the plot (OPTIONAL)(UNFINISHED)
      Specified by:
        `finishPlotMerge` in class `PlotManager`

    - #### finishPlotUnlink

          public boolean finishPlotUnlink(org.bukkit.World world,
                                 PlotWorld plotworld,
                                 java.util.ArrayList<PlotId> plotIds)

      Specified by:
        `finishPlotUnlink` in class `PlotManager`

    - #### startPlotMerge

          public boolean startPlotMerge(org.bukkit.World world,
                               PlotWorld plotworld,
                               java.util.ArrayList<PlotId> plotIds)

      Specified by:
        `startPlotMerge` in class `PlotManager`

    - #### startPlotUnlink

          public boolean startPlotUnlink(org.bukkit.World world,
                                PlotWorld plotworld,
                                java.util.ArrayList<PlotId> plotIds)

      Specified by:
        `startPlotUnlink` in class `PlotManager`