protected boolean checkObjectInRange(VisibleObject newObject) { // check if Z distance is greater than maxZvisibleDistance if (Math.abs(owner.getZ() - newObject.getZ()) > owner.getMaxZVisibleDistance()) { return false; } return MathUtil.isInRange(owner, newObject, owner.getVisibilityDistance()); }