if (target.isDestroyed()) {
return;
}
WorldSky camera = target.getWorld().getSky();
Rectangle2D followBounds = target.objectToSky(target.getBounds());
double x = followBounds.getX() - ((getWidth() - followBounds.getWidth()) / 2f);
double y = followBounds.getY() + followBounds.getHeight();
if (x + getWidth() > camera.getBounds().getWidth()) {
x = camera.getBounds().getWidth() - getWidth();
}
if (x < 0) {
x = 0;
}
if ((y + getHeight() > camera.getBounds().getHeight())
&& ((followBounds.getY() - getHeight()) > 0)) {
y = followBounds.getY() - getHeight();
}