{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/48693813","id":48693813,"diff_hunk":"@@ -0,0 +1,73 @@\n+=====================\n+Using the Economy API\n+=====================\n+\n+The Economy API unifies all economy plugins under one API. This means any plugin using the Economy API\n+will be compatible with all economy plugins that implement the API. This page guides you through the steps of using \n+the Economy API in your own plugin.\n+\n+Loading the EconomyService\n+==========================\n+\n+In order to utilize the Economy API, you must first load the EconomyService class:\n+\n+1. Listen to the ``ChangeServiceProviderEvent`` in order to grab an instance of the EconomyService when it is \n+registered.\n+\n+2. When the event is fired, check if the service added was the ``EconomyService``. If the it was the \n+``EconomyService``, assign it to a variable that can be used to later access the Economy API.\n+\n+**Example: Loading the EconomyService**\n+\n+.. code-block:: java\n+\n+\timport org.spongepowered.api.event.Listener;\n+\timport org.spongepowered.api.event.service.ChangeServiceProviderEvent;\n+\timport org.spongepowered.api.service.economy.EconomyService;\n+\n+\tprivate EconomyService economyService;\n+\t\n+\t@Listener\n+\tpublic void onChangeServiceProvider(ChangeServiceProviderEvent event) {\n+\t\tif (event.getService().equals(EconomyService.class)) {\n+\t\t\tObject rawProvider = event.getNewProviderRegistration().getProvider();\n+\t\t\tif (rawProvider instanceof EconomyService) {","path":"source/plugin/economy/using.rst","position":34,"original_position":34,"commit_id":"ba7ab532581afabe72302930041da2b719d04140","original_commit_id":"ba7ab532581afabe72302930041da2b719d04140","user":{"login":"Aaron1011","id":1408859,"avatar_url":"https://avatars.githubusercontent.com/u/1408859?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaron1011","html_url":"https://github.com/Aaron1011","followers_url":"https://api.github.com/users/Aaron1011/followers","following_url":"https://api.github.com/users/Aaron1011/following{/other_user}","gists_url":"https://api.github.com/users/Aaron1011/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaron1011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaron1011/subscriptions","organizations_url":"https://api.github.com/users/Aaron1011/orgs","repos_url":"https://api.github.com/users/Aaron1011/repos","events_url":"https://api.github.com/users/Aaron1011/events{/privacy}","received_events_url":"https://api.github.com/users/Aaron1011/received_events","type":"User","site_admin":false},"body":"You can directly cast here. The `ServiceManager` ensures that the provider implements the service, through a generic type bound.","created_at":"2016-01-03T14:45:38Z","updated_at":"2016-01-03T14:45:38Z","html_url":"https://github.com/SpongePowered/SpongeDocs/pull/416#discussion_r48693813","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/48693813"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/416#discussion_r48693813"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416","id":54925739,"html_url":"https://github.com/SpongePowered/SpongeDocs/pull/416","diff_url":"https://github.com/SpongePowered/SpongeDocs/pull/416.diff","patch_url":"https://github.com/SpongePowered/SpongeDocs/pull/416.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/416","number":416,"state":"open","locked":false,"title":"Economy API Documentation","user":{"login":"Flibio","id":12263478,"avatar_url":"https://avatars.githubusercontent.com/u/12263478?v=3","gravatar_id":"","url":"https://api.github.com/users/Flibio","html_url":"https://github.com/Flibio","followers_url":"https://api.github.com/users/Flibio/followers","following_url":"https://api.github.com/users/Flibio/following{/other_user}","gists_url":"https://api.github.com/users/Flibio/gists{/gist_id}","starred_url":"https://api.github.com/users/Flibio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flibio/subscriptions","organizations_url":"https://api.github.com/users/Flibio/orgs","repos_url":"https://api.github.com/users/Flibio/repos","events_url":"https://api.github.com/users/Flibio/events{/privacy}","received_events_url":"https://api.github.com/users/Flibio/received_events","type":"User","site_admin":false},"body":"Documentation for the Economy API. Any input is appreciated. \r\n\r\nFeatures of this PR:\r\n\r\n- [x] Documents Economy API basics\r\n- [x] Gets you on the right path to implement the Economy API\r\n- [x] Describes and provides examples for using the Economy API\r\n\r\nMoved from #405","created_at":"2016-01-03T14:32:43Z","updated_at":"2016-01-03T14:45:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75b49bc7224322d38a78b8e1b087abd3b4eaa3b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/416/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/ba7ab532581afabe72302930041da2b719d04140","head":{"label":"SpongePowered:feature/economy","ref":"feature/economy","sha":"ba7ab532581afabe72302930041da2b719d04140","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","created_at":"2014-11-23T06:56:04Z","updated_at":"2015-12-24T20:37:25Z","pushed_at":"2016-01-03T14:32:44Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5830,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":59,"forks":62,"open_issues":59,"watchers":49,"default_branch":"master"}},"base":{"label":"SpongePowered:master","ref":"master","sha":"91c86311c35610d81f261d15bdca655b1bda9a35","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","created_at":"2014-11-23T06:56:04Z","updated_at":"2015-12-24T20:37:25Z","pushed_at":"2016-01-03T14:32:44Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5830,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":59,"forks":62,"open_issues":59,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/416"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/416"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/416/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/416/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/ba7ab532581afabe72302930041da2b719d04140"}}}}