player.mountEntity(fakeEntity);
}
public static Vector3 getFootprintPosition(World world, float rotation, Vector3 startPosition, BlockVec3 playerCenter)
{
Vector3 position = startPosition.clone();
float footprintScale = 0.375F;
int mainPosX = position.intX();
int mainPosY = position.intY();
int mainPosZ = position.intZ();
// If the footprint is hovering over air...
if (world.getBlock(mainPosX, mainPosY, mainPosZ).isAir(world, mainPosX, mainPosY, mainPosZ))
{
position.x += (playerCenter.x - mainPosX);
position.z += (playerCenter.z - mainPosZ);
// If the footprint is still over air....
if (world.getBlock(position.intX(), position.intY(), position.intZ()).isAir(world, position.intX(), position.intY(), position.intZ()))
{
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if (direction != ForgeDirection.DOWN && direction != ForgeDirection.UP)
{
if (!world.getBlock(mainPosX + direction.offsetX, mainPosY, mainPosZ + direction.offsetZ).isAir(world, mainPosX + direction.offsetX, mainPosY, mainPosZ + direction.offsetZ))
{
position.x += direction.offsetX;
position.z += direction.offsetZ;
break;
}
}
}
}
}
mainPosX = position.intX();
mainPosZ = position.intZ();
double x0 = (Math.sin((45 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x1 = (Math.sin((135 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x2 = (Math.sin((225 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;
double x3 = (Math.sin((315 - rotation) * Math.PI / 180.0D) * footprintScale) + position.x;