Package com.Moshu.Misc
Class Locations
java.lang.Object
com.Moshu.Misc.Locations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
blacklistedBiome
(org.bukkit.Location loc) Checks if the biome at the location is a blacklisted biomestatic boolean
check
(org.bukkit.Location loc, int maxTreasureDistance) static double
distanceTo
(org.bukkit.Location loc1, org.bukkit.Location loc2) static double
getBorder
(org.bukkit.World w) static org.bukkit.Location
getRandomLocationMoreThan
(org.bukkit.World w, int maxTreasureDistance, double distance, double min) Get a safe, random locationstatic boolean
inAir
(org.bukkit.Location loc) Checks if the location under the location is airstatic void
init()
static boolean
isAir
(org.bukkit.Location l) Checks if the block at the location is airstatic boolean
isAllowedWorld
(org.bukkit.World w) static boolean
isInBorder
(org.bukkit.Location l, int maxTreasureDistance) static boolean
isInRegion
(org.bukkit.Chunk c, int y) Checks if the chunk is in a region at allstatic boolean
isInRegion
(org.bukkit.Location loc) Checks if the location is in a region at allstatic boolean
isInRegion
(org.bukkit.Location loc, String regionName) Checks if current location is in a WorldGuard regionstatic boolean
isLeaves
(org.bukkit.Location loc) Checks if the block at the location is a type of leafstatic boolean
isLiquid
(org.bukkit.Location loc) Checks if location is a liqudstatic boolean
isLiquidAbove
(org.bukkit.Location loc) Checks if the location above the location is a liqudstatic boolean
isLiquidUnder
(org.bukkit.Location loc) Checks if location under the location is a liqudstatic boolean
isPassableBlockUnder
(org.bukkit.Location loc) static boolean
isSafeEnough
(org.bukkit.Location loc) static boolean
isUnsafe
(org.bukkit.Location loc, int maxTreasureDistance) Checks if a location is considered unsafe based on check()static void
load
(org.bukkit.Location l) Loads a chunk
-
Constructor Details
-
Locations
public Locations()
-
-
Method Details
-
init
public static void init() -
isAllowedWorld
public static boolean isAllowedWorld(org.bukkit.World w) -
isInRegion
Checks if current location is in a WorldGuard region- Parameters:
loc
- the locationregionName
- the regions name- Returns:
- true/false
-
isInRegion
public static boolean isInRegion(org.bukkit.Location loc) Checks if the location is in a region at all- Parameters:
loc
- the location- Returns:
- true/false
-
isInRegion
public static boolean isInRegion(org.bukkit.Chunk c, int y) Checks if the chunk is in a region at all- Parameters:
c
- the chunk- Returns:
- true/false
-
isLiquid
public static boolean isLiquid(org.bukkit.Location loc) Checks if location is a liqud- Parameters:
loc
- the location- Returns:
- true/false
-
isLiquidAbove
public static boolean isLiquidAbove(org.bukkit.Location loc) Checks if the location above the location is a liqud- Parameters:
loc
- the location- Returns:
- true/false
-
isLiquidUnder
public static boolean isLiquidUnder(org.bukkit.Location loc) Checks if location under the location is a liqud- Parameters:
loc
- the location- Returns:
- true/false
-
isUnsafe
public static boolean isUnsafe(org.bukkit.Location loc, int maxTreasureDistance) Checks if a location is considered unsafe based on check()- Parameters:
loc
- the location- Returns:
- true/false
-
isSafeEnough
public static boolean isSafeEnough(org.bukkit.Location loc) -
check
public static boolean check(org.bukkit.Location loc, int maxTreasureDistance) - Parameters:
loc
- , the location- Returns:
- true if the location is safe and false if the location is not suitable for a player
-
isPassableBlockUnder
public static boolean isPassableBlockUnder(org.bukkit.Location loc) -
inAir
public static boolean inAir(org.bukkit.Location loc) Checks if the location under the location is air- Parameters:
loc
- the location- Returns:
- true/false
-
load
public static void load(org.bukkit.Location l) Loads a chunk- Parameters:
l
- the location
-
blacklistedBiome
public static boolean blacklistedBiome(org.bukkit.Location loc) Checks if the biome at the location is a blacklisted biome- Parameters:
loc
- the location- Returns:
- true/false
-
isLeaves
public static boolean isLeaves(org.bukkit.Location loc) Checks if the block at the location is a type of leaf- Parameters:
loc
- the location- Returns:
- true/false
-
isAir
public static boolean isAir(org.bukkit.Location l) Checks if the block at the location is air- Parameters:
l
- the location- Returns:
- true/false
-
isInBorder
public static boolean isInBorder(org.bukkit.Location l, int maxTreasureDistance) -
distanceTo
public static double distanceTo(org.bukkit.Location loc1, org.bukkit.Location loc2) -
getBorder
public static double getBorder(org.bukkit.World w) -
getRandomLocationMoreThan
public static org.bukkit.Location getRandomLocationMoreThan(org.bukkit.World w, int maxTreasureDistance, double distance, double min) Get a safe, random location- Parameters:
w
- the world of the treasuredistance
- the distance from the center of the world- Returns:
- the safe location
-