public class PlotHelper
extends java.lang.Object
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 and Description |
---|
PlotHelper()
|
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)
|
public static boolean canSetFast
public static java.util.ArrayList<java.lang.String> runners_p
public static java.util.HashMap<Plot,java.lang.Integer> runners
public static PlotId getPlotIdRelative(PlotId id, int direction)
id
-direction
-public static boolean mergePlots(org.bukkit.entity.Player plr, org.bukkit.World world, java.util.ArrayList<PlotId> plotIds)
plr
-world
-plotIds
-public static boolean mergePlots(org.bukkit.World world, java.util.ArrayList<PlotId> plotIds)
world
-plotIds
-public static void mergePlot(org.bukkit.World world, Plot lesserPlot, Plot greaterPlot)
world
-lesserPlot
-greaterPlot
-public static final long nextLong()
public static final long xorShift64(long a)
public static final int random(int n)
public static void removeSign(org.bukkit.World world, Plot p)
public static void setSign(org.bukkit.entity.Player player, Plot p)
public static void setSign(org.bukkit.World world, java.lang.String name, Plot p)
public static java.lang.String getPlayerName(java.util.UUID uuid)
public static java.lang.String getStringSized(int max, java.lang.String string)
public static boolean setBlock(org.bukkit.block.Block block, PlotBlock plotblock)
block
-plotblock
-public static void adjustWall(org.bukkit.entity.Player player, Plot plot, PlotBlock block)
player
-plot
-block
-public static void autoMerge(org.bukkit.World world, Plot plot, org.bukkit.entity.Player player)
public static boolean createPlot(org.bukkit.entity.Player player, Plot plot)
public static int getLoadedChunks(org.bukkit.World world)
public static int getEntities(org.bukkit.World world)
public static int getTileEntities(org.bukkit.World world)
public static double getWorldFolderSize(org.bukkit.World world)
public static java.lang.String createId(int x, int z)
public static void adjustWallFilling(org.bukkit.entity.Player requester, Plot plot, PlotBlock block)
public static void setFloor(org.bukkit.entity.Player requester, Plot plot, PlotBlock[] blocks)
public static int square(int x)
public static short[] getBlock(java.lang.String block)
public static void clearAllEntities(org.bukkit.World world, Plot plot, boolean tile)
public static void clear(org.bukkit.World world, Plot plot)
public static void clear(org.bukkit.entity.Player requester, Plot plot)
requester
-plot
-public static void setCuboid(org.bukkit.World world, org.bukkit.Location pos1, org.bukkit.Location pos2, PlotBlock[] blocks)
public static void setSimpleCuboid(org.bukkit.World world, org.bukkit.Location pos1, org.bukkit.Location pos2, PlotBlock newblock)
public static void setBiome(org.bukkit.World world, Plot plot, org.bukkit.block.Biome b)
public static int getHeighestBlock(org.bukkit.World world, int x, int z)
public static org.bukkit.Location getPlotHome(org.bukkit.World w, PlotId plotid)
public static org.bukkit.Location getPlotHome(org.bukkit.World w, Plot plot)
public static void refreshPlotChunks(org.bukkit.World world, Plot plot)
public static org.bukkit.Location getPlotTopLocAbs(org.bukkit.World world, PlotId id)
world
-id
-public static org.bukkit.Location getPlotBottomLocAbs(org.bukkit.World world, PlotId id)
world
-id
-public static int getPlotWidth(org.bukkit.World world, PlotId id)
world
-id
-public static org.bukkit.Location getPlotTopLoc(org.bukkit.World world, PlotId id)
world
-id
-public static org.bukkit.Location getPlotBottomLoc(org.bukkit.World world, PlotId id)
world
-id
-public static Plot getPlot(org.bukkit.World world, PlotId id)
world
-id
-public static Plot getCurrentPlot(org.bukkit.Location loc)
loc
-