Interface BlockSafety
-
- All Known Implementing Classes:
SimpleBlockSafety
public interface BlockSafety
Used to get block/location-related information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canSpawnCartSafely(org.bukkit.entity.Minecart cart)
Checks if the specifiedMinecart
can spawn safely.boolean
canSpawnVehicleSafely(org.bukkit.entity.Vehicle vehicle)
Checks if the specifiedVehicle
can spawn safely.org.bukkit.Location
getBottomBlock(org.bukkit.Location l)
Gets the location of the top block at the specifiedLocation
.org.bukkit.Location
getSafeBedSpawn(org.bukkit.Location l)
Gets a safe bed spawn location OR null if the bed is invalid.org.bukkit.Location
getTopBlock(org.bukkit.Location l)
Gets the location of the top block at the specifiedLocation
.boolean
isBlockAboveAir(org.bukkit.Location l)
This function checks whether the block at the given coordinates are above air or not.boolean
isEntitiyOnTrack(org.bukkit.Location l)
Checks if an entity would be on track at the specifiedLocation
.boolean
playerCanSpawnHereSafely(org.bukkit.Location l)
This function checks whether the block at the coordinates given is safe or not by checking for Lava/Fire/Air etc.boolean
playerCanSpawnHereSafely(org.bukkit.World world, double x, double y, double z)
Checks if a player can spawn safely at the given coordinates.
-
-
-
Method Detail
-
isBlockAboveAir
boolean isBlockAboveAir(org.bukkit.Location l)
This function checks whether the block at the given coordinates are above air or not.- Parameters:
l
- TheLocation
of the block.- Returns:
- True if the block at that
Location
is above air.
-
playerCanSpawnHereSafely
boolean playerCanSpawnHereSafely(org.bukkit.World world, double x, double y, double z)
Checks if a player can spawn safely at the given coordinates.- Parameters:
world
- TheWorld
.x
- The x-coordinate.y
- The y-coordinate.z
- The z-coordinate.- Returns:
- True if a player can spawn safely at the given coordinates.
-
playerCanSpawnHereSafely
boolean playerCanSpawnHereSafely(org.bukkit.Location l)
This function checks whether the block at the coordinates given is safe or not by checking for Lava/Fire/Air etc. This also ensures there is enough space for a player to spawn!- Parameters:
l
- TheLocation
- Returns:
- Whether the player can spawn safely at the given
Location
-
getSafeBedSpawn
org.bukkit.Location getSafeBedSpawn(org.bukkit.Location l)
Gets a safe bed spawn location OR null if the bed is invalid.- Parameters:
l
- The location of the bead head (block with the pillow on it).- Returns:
- Safe location around the bed or null if no location was found.
-
getTopBlock
org.bukkit.Location getTopBlock(org.bukkit.Location l)
Gets the location of the top block at the specifiedLocation
.- Parameters:
l
- AnyLocation
.- Returns:
- The
Location
of the top-block.
-
getBottomBlock
org.bukkit.Location getBottomBlock(org.bukkit.Location l)
Gets the location of the top block at the specifiedLocation
.- Parameters:
l
- AnyLocation
.- Returns:
- The
Location
of the top-block.
-
isEntitiyOnTrack
boolean isEntitiyOnTrack(org.bukkit.Location l)
Checks if an entity would be on track at the specifiedLocation
.- Parameters:
l
- TheLocation
.- Returns:
- True if an entity would be on tracks at the specified
Location
.
-
canSpawnCartSafely
boolean canSpawnCartSafely(org.bukkit.entity.Minecart cart)
Checks if the specifiedMinecart
can spawn safely.- Parameters:
cart
- TheMinecart
.- Returns:
- True if the minecart can spawn safely.
-
canSpawnVehicleSafely
boolean canSpawnVehicleSafely(org.bukkit.entity.Vehicle vehicle)
Checks if the specifiedVehicle
can spawn safely.- Parameters:
vehicle
- TheVehicle
.- Returns:
- True if the vehicle can spawn safely.
-
-