Class SimpleBlockSafety

    • Method Summary

      All Methods Static Methods Instance Methods Concrete 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.
      static boolean isSolidBlock​(org.bukkit.Material type)  
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleBlockSafety

        public SimpleBlockSafety​(Core plugin)
    • Method Detail

      • isBlockAboveAir

        public boolean isBlockAboveAir​(org.bukkit.Location l)
        This function checks whether the block at the given coordinates are above air or not.
        Specified by:
        isBlockAboveAir in interface BlockSafety
        Parameters:
        l - The Location of the block.
        Returns:
        True if the block at that Location is above air.
      • playerCanSpawnHereSafely

        public boolean playerCanSpawnHereSafely​(org.bukkit.World world,
                                                double x,
                                                double y,
                                                double z)
        Checks if a player can spawn safely at the given coordinates.
        Specified by:
        playerCanSpawnHereSafely in interface BlockSafety
        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

        public 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!
        Specified by:
        playerCanSpawnHereSafely in interface BlockSafety
        Parameters:
        l - The Location
        Returns:
        Whether the player can spawn safely at the given Location
      • getSafeBedSpawn

        public org.bukkit.Location getSafeBedSpawn​(org.bukkit.Location l)
        Gets a safe bed spawn location OR null if the bed is invalid.
        Specified by:
        getSafeBedSpawn in interface BlockSafety
        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

        public org.bukkit.Location getTopBlock​(org.bukkit.Location l)
        Gets the location of the top block at the specified Location.
        Specified by:
        getTopBlock in interface BlockSafety
        Parameters:
        l - Any Location.
        Returns:
        The Location of the top-block.
      • getBottomBlock

        public org.bukkit.Location getBottomBlock​(org.bukkit.Location l)
        Gets the location of the top block at the specified Location.
        Specified by:
        getBottomBlock in interface BlockSafety
        Parameters:
        l - Any Location.
        Returns:
        The Location of the top-block.
      • isSolidBlock

        public static boolean isSolidBlock​(org.bukkit.Material type)
      • isEntitiyOnTrack

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

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

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