Class BlockFaceUtil

java.lang.Object
com.ranull.graves.util.BlockFaceUtil

public final class BlockFaceUtil extends Object
Utility class for handling BlockFace related operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.Rotation
    getBlockFaceRotation(org.bukkit.block.BlockFace blockFace)
    Gets the rotation corresponding to the given BlockFace.
    static int
    getBlockFaceYaw(org.bukkit.block.BlockFace blockFace)
    Converts a BlockFace to the corresponding yaw angle.
    static org.bukkit.block.BlockFace
    getEntityYawBlockFace(org.bukkit.entity.LivingEntity livingEntity)
    Gets the BlockFace corresponding to the yaw of the given LivingEntity.
    static org.bukkit.block.BlockFace
    getSimpleBlockFace(org.bukkit.block.BlockFace blockFace)
    Simplifies the given BlockFace to one of the four cardinal directions (NORTH, EAST, SOUTH, WEST).
    static org.bukkit.block.BlockFace
    getYawBlockFace(float yaw)
    Converts a yaw angle to the corresponding BlockFace.

    Methods inherited from class java.lang.Object

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

    • BlockFaceUtil

      public BlockFaceUtil()
  • Method Details

    • getSimpleBlockFace

      public static org.bukkit.block.BlockFace getSimpleBlockFace(org.bukkit.block.BlockFace blockFace)
      Simplifies the given BlockFace to one of the four cardinal directions (NORTH, EAST, SOUTH, WEST).
      Parameters:
      blockFace - The BlockFace to simplify.
      Returns:
      The simplified BlockFace.
    • getEntityYawBlockFace

      public static org.bukkit.block.BlockFace getEntityYawBlockFace(org.bukkit.entity.LivingEntity livingEntity)
      Gets the BlockFace corresponding to the yaw of the given LivingEntity.
      Parameters:
      livingEntity - The LivingEntity whose yaw is used.
      Returns:
      The BlockFace corresponding to the yaw.
    • getBlockFaceRotation

      public static org.bukkit.Rotation getBlockFaceRotation(org.bukkit.block.BlockFace blockFace)
      Gets the rotation corresponding to the given BlockFace.
      Parameters:
      blockFace - The BlockFace to convert.
      Returns:
      The corresponding Rotation.
    • getYawBlockFace

      public static org.bukkit.block.BlockFace getYawBlockFace(float yaw)
      Converts a yaw angle to the corresponding BlockFace.
      Parameters:
      yaw - The yaw angle to convert.
      Returns:
      The corresponding BlockFace.
    • getBlockFaceYaw

      public static int getBlockFaceYaw(org.bukkit.block.BlockFace blockFace)
      Converts a BlockFace to the corresponding yaw angle.
      Parameters:
      blockFace - The BlockFace to convert.
      Returns:
      The corresponding yaw angle.