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 specified Minecart can spawn safely.
      boolean canSpawnVehicleSafely​(org.bukkit.entity.Vehicle vehicle)
      Checks if the specified Vehicle can spawn safely.
      org.bukkit.Location getBottomBlock​(org.bukkit.Location l)
      Gets the location of the top block at the specified Location.
      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 specified Location.
      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 specified Location.
      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 - The Location 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 - The World.
        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 - The Location
        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 specified Location.
        Parameters:
        l - Any Location.
        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 specified Location.
        Parameters:
        l - Any Location.
        Returns:
        The Location of the top-block.
      • isEntitiyOnTrack

        boolean isEntitiyOnTrack​(org.bukkit.Location l)
        Checks if an entity would be on track at the specified Location.
        Parameters:
        l - The Location.
        Returns:
        True if an entity would be on tracks at the specified Location.
      • canSpawnCartSafely

        boolean canSpawnCartSafely​(org.bukkit.entity.Minecart cart)
        Checks if the specified Minecart can spawn safely.
        Parameters:
        cart - The Minecart.
        Returns:
        True if the minecart can spawn safely.
      • canSpawnVehicleSafely

        boolean canSpawnVehicleSafely​(org.bukkit.entity.Vehicle vehicle)
        Checks if the specified Vehicle can spawn safely.
        Parameters:
        vehicle - The Vehicle.
        Returns:
        True if the vehicle can spawn safely.