// Perform movement updates
final double oldDx = dx;
final double oldDy = dy;
final double oldDz = dz;
AxisAlignedBB axisalignedbb = handle.boundingBox.clone();
List<AxisAlignedBB> list = EntityControllerCollisionHelper.getCollisions(this, handle.boundingBox.a(dx, dy, dz));
// Collision testing using Y
for (AxisAlignedBB aabb : list) {
dy = aabb.b(handle.boundingBox, dy);
}
handle.boundingBox.d(0.0, dy, 0.0);
if (!handle.J && oldDy != dy) {
dx = dy = dz = 0.0;
}
boolean isOnGround = handle.onGround || oldDy != dy && oldDy < 0.0;
// Collision testing using X
for (AxisAlignedBB aabb : list) {
dx = aabb.a(handle.boundingBox, dx);
}
handle.boundingBox.d(dx, 0.0, 0.0);
if (!handle.J && oldDx != dx) {
dx = dy = dz = 0.0;
}
// Collision testing using Z
for (AxisAlignedBB aabb : list) {
dz = aabb.c(handle.boundingBox, dz);
}
handle.boundingBox.d(0.0, 0.0, dz);
if (!handle.J && oldDz != dz) {
dx = dy = dz = 0.0;
}
double moveDx;
double moveDy;
double moveDz;
if (handle.Y > 0.0f && handle.Y < 0.05f && isOnGround && (oldDx != dx || oldDz != dz)) {
moveDx = dx;
moveDy = dy;
moveDz = dz;
dx = oldDx;
dy = (double) handle.Y;
dz = oldDz;
AxisAlignedBB axisalignedbb1 = handle.boundingBox.clone();
handle.boundingBox.d(axisalignedbb);
list = EntityControllerCollisionHelper.getCollisions(this, handle.boundingBox.a(oldDx, dy, oldDz));
// Collision testing using Y