Interface BlockSafety
-
- All Known Implementing Classes:
SimpleBlockSafety
public interface BlockSafetyUsed to get block/location-related information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanSpawnCartSafely(org.bukkit.entity.Minecart cart)Checks if the specifiedMinecartcan spawn safely.booleancanSpawnVehicleSafely(org.bukkit.entity.Vehicle vehicle)Checks if the specifiedVehiclecan spawn safely.org.bukkit.LocationgetBottomBlock(org.bukkit.Location l)Gets the location of the top block at the specifiedLocation.org.bukkit.LocationgetSafeBedSpawn(org.bukkit.Location l)Gets a safe bed spawn location OR null if the bed is invalid.org.bukkit.LocationgetTopBlock(org.bukkit.Location l)Gets the location of the top block at the specifiedLocation.booleanisBlockAboveAir(org.bukkit.Location l)This function checks whether the block at the given coordinates are above air or not.booleanisEntitiyOnTrack(org.bukkit.Location l)Checks if an entity would be on track at the specifiedLocation.booleanplayerCanSpawnHereSafely(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.booleanplayerCanSpawnHereSafely(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- TheLocationof the block.- Returns:
- True if the block at that
Locationis 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
Locationof 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
Locationof 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 specifiedMinecartcan spawn safely.- Parameters:
cart- TheMinecart.- Returns:
- True if the minecart can spawn safely.
-
canSpawnVehicleSafely
boolean canSpawnVehicleSafely(org.bukkit.entity.Vehicle vehicle)
Checks if the specifiedVehiclecan spawn safely.- Parameters:
vehicle- TheVehicle.- Returns:
- True if the vehicle can spawn safely.
-
-