Package com.ranull.graves.util
Class BlockFaceUtil
java.lang.Object
com.ranull.graves.util.BlockFaceUtil
Utility class for handling BlockFace related operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.RotationgetBlockFaceRotation(org.bukkit.block.BlockFace blockFace) Gets the rotation corresponding to the given BlockFace.static intgetBlockFaceYaw(org.bukkit.block.BlockFace blockFace) Converts a BlockFace to the corresponding yaw angle.static org.bukkit.block.BlockFacegetEntityYawBlockFace(org.bukkit.entity.LivingEntity livingEntity) Gets the BlockFace corresponding to the yaw of the given LivingEntity.static org.bukkit.block.BlockFacegetSimpleBlockFace(org.bukkit.block.BlockFace blockFace) Simplifies the given BlockFace to one of the four cardinal directions (NORTH, EAST, SOUTH, WEST).static org.bukkit.block.BlockFacegetYawBlockFace(float yaw) Converts a yaw angle to the corresponding BlockFace.
-
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.
-