public static BlockFace getBlockFacing(Block block, Entity entity) {
Point position;
EntityHead head = entity.get(EntityHead.class);
position = head != null ? head.getPosition() : entity.getPhysics().getPosition();
Vector3f diff = position.sub(block.getX(), block.getY(), block.getZ());
if (Math.abs(diff.getX()) < 2.0f && Math.abs(diff.getZ()) < 2.0f) {
if (diff.getY() > 1.8f) {
return BlockFace.TOP;
} else if (diff.getY() < -0.2f) {
return BlockFace.BOTTOM;