public class LocationUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LocationUtils.Direction |
Constructor and Description |
---|
LocationUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
getAngleTo(Player p,
Location loc)
Deprecated.
|
static LocationUtils.Direction |
getDirection(Player p,
Location loc) |
static int |
getNbAirBlockDown(Player p)
Get the number of air below the specified player
|
static float |
getPlayerHeadHeight(Player p) |
static Vector |
getPlayerVec(Player p) |
static boolean |
hasBoatAroundHim(Location loc)
Check is there is a boat around the location (Distance of 3)
|
static boolean |
hasExtended(Location loc,
String m)
Check if there is material around specified location
|
static boolean |
hasLineOfSight(Player p,
Location loc) |
static boolean |
hasMaterialAround(Location loc,
Material... ms)
Check if there is material around specified location
(1 block radius)
|
static boolean |
hasMaterialsAround(Location loc,
String... ms)
Check if there is material around specified location
(1 block radius)
|
protected static boolean |
hasMovingPosition(World world,
Location position,
Vector vec3d,
Vector vec3d1) |
static boolean |
hasOtherThan(Location loc,
Material m)
Check if there is other than material around specified location
|
static boolean |
hasOtherThan(Location loc,
String name)
Check if there is other than material around specified location
|
static boolean |
hasOtherThanExtended(Location loc,
Material m)
Check if there is other than material around specified location
|
static boolean |
hasOtherThanExtended(Location loc,
String m)
Check if there is other than material around specified location
|
static boolean |
isBlockOfType(Location location,
String... materials) |
static boolean |
isInWater(Location loc) |
static boolean |
isUsingElevator(Player p) |
static void |
teleportPlayerOnGround(Player p) |
public static boolean isUsingElevator(Player p)
public static boolean hasMaterialAround(Location loc, Material... ms)
loc
- the location where you want to checkms
- Material that we are searchingpublic static boolean hasMaterialsAround(Location loc, String... ms)
loc
- the location where you want to checkms
- Material's name that we are searchingWarn: For 'REDSTONE', we will also find 'REDSTONE_BLOCK' and all other block with contains name ...public static boolean hasOtherThanExtended(Location loc, Material m)
loc
- the location where you want to checkm
- The material that we are searchingpublic static boolean hasOtherThanExtended(Location loc, String m)
loc
- the location where you want to checkm
- the name that we are searching in material namespublic static boolean hasExtended(Location loc, String m)
loc
- the location where you want to checkm
- the name that we are searching in material namespublic static boolean hasOtherThan(Location loc, Material m)
loc
- the location where you want to checkm
- The material that we are searchingpublic static boolean hasOtherThan(Location loc, String name)
loc
- the location where you want to checkname
- the name that we are searching in material namespublic static boolean hasBoatAroundHim(Location loc)
loc
- The location to checkpublic static int getNbAirBlockDown(Player p)
p
- the player to know how many air blocks he has belowpublic static float getPlayerHeadHeight(Player p)
protected static boolean hasMovingPosition(World world, Location position, Vector vec3d, Vector vec3d1)
public static void teleportPlayerOnGround(Player p)
public static boolean isInWater(Location loc)
@Deprecated public static double getAngleTo(Player p, Location loc)
p
- the player which is requiring for directionloc
- the directionpublic static LocationUtils.Direction getDirection(Player p, Location loc)