{"action":"created","comment":{"url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/comments/24760519","id":24760519,"diff_hunk":"@@ -0,0 +1,58 @@\n+package in.twizmwaz.cardinal.util;\n+\n+import org.bukkit.Color;\n+import org.bukkit.FireworkEffect;\n+import org.bukkit.Location;\n+import org.bukkit.World;\n+import org.bukkit.entity.Firework;\n+import org.bukkit.inventory.meta.FireworkMeta;\n+\n+import java.util.Random;\n+\n+public class FireworkUtil {\n+\n+    public static void spawnFirework(Location location, World world) {\n+        Firework firework = (Firework) world.spawn(location, Firework.class);\n+        FireworkMeta fireworkMeta = firework.getFireworkMeta();\n+        Random random = new Random();\n+        int randomColor = random.nextInt(17);\n+        FireworkEffect effect = FireworkEffect.builder().withColor(randomColor(randomColor)).with(FireworkEffect.Type.BALL).trail(true).build();\n+        fireworkMeta.addEffect(effect);\n+        fireworkMeta.setPower(0);\n+        firework.setFireworkMeta(fireworkMeta);\n+    }\n+\n+    public static void spawnFirework(Location location, World world, Color color) {\n+        Firework firework = (Firework) world.spawn(location, Firework.class);\n+        FireworkMeta fireworkMeta = firework.getFireworkMeta();\n+        FireworkEffect effect = FireworkEffect.builder().withColor(color).with(FireworkEffect.Type.BALL).trail(true).build();\n+        fireworkMeta.addEffect(effect);\n+        fireworkMeta.setPower(0);\n+        firework.setFireworkMeta(fireworkMeta);\n+    }\n+\n+    private static Color randomColor(int c) {","path":"src/main/java/in/twizmwaz/cardinal/util/FireworkUtil.java","position":34,"original_position":34,"commit_id":"a9a61ff212b3c9ddb5d26b1cd7d0bbbe2ef21c81","original_commit_id":"a9a61ff212b3c9ddb5d26b1cd7d0bbbe2ef21c81","user":{"login":"twizmwazin","id":1341797,"avatar_url":"https://avatars.githubusercontent.com/u/1341797?v=3","gravatar_id":"","url":"https://api.github.com/users/twizmwazin","html_url":"https://github.com/twizmwazin","followers_url":"https://api.github.com/users/twizmwazin/followers","following_url":"https://api.github.com/users/twizmwazin/following{/other_user}","gists_url":"https://api.github.com/users/twizmwazin/gists{/gist_id}","starred_url":"https://api.github.com/users/twizmwazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twizmwazin/subscriptions","organizations_url":"https://api.github.com/users/twizmwazin/orgs","repos_url":"https://api.github.com/users/twizmwazin/repos","events_url":"https://api.github.com/users/twizmwazin/events{/privacy}","received_events_url":"https://api.github.com/users/twizmwazin/received_events","type":"User","site_admin":false},"body":"Why the int if it is random? Random.nextInt(16) will return a pseudo-random int between 0-16.","created_at":"2015-02-16T16:26:13Z","updated_at":"2015-02-16T16:26:13Z","html_url":"https://github.com/twizmwazin/CardinalPGM/pull/181#discussion_r24760519","pull_request_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/comments/24760519"},"html":{"href":"https://github.com/twizmwazin/CardinalPGM/pull/181#discussion_r24760519"},"pull_request":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181","id":29383452,"html_url":"https://github.com/twizmwazin/CardinalPGM/pull/181","diff_url":"https://github.com/twizmwazin/CardinalPGM/pull/181.diff","patch_url":"https://github.com/twizmwazin/CardinalPGM/pull/181.patch","issue_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/181","number":181,"state":"open","locked":false,"title":"Implement firework methods","user":{"login":"CaptainElliott","id":6588138,"avatar_url":"https://avatars.githubusercontent.com/u/6588138?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainElliott","html_url":"https://github.com/CaptainElliott","followers_url":"https://api.github.com/users/CaptainElliott/followers","following_url":"https://api.github.com/users/CaptainElliott/following{/other_user}","gists_url":"https://api.github.com/users/CaptainElliott/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainElliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainElliott/subscriptions","organizations_url":"https://api.github.com/users/CaptainElliott/orgs","repos_url":"https://api.github.com/users/CaptainElliott/repos","events_url":"https://api.github.com/users/CaptainElliott/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainElliott/received_events","type":"User","site_admin":false},"body":"Basic methods to implement fireworks into other modules ","created_at":"2015-02-16T16:06:07Z","updated_at":"2015-02-16T16:26:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a050f4d7c18592acab4f1be69eaeac589f1e667c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181/commits","review_comments_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181/comments","review_comment_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/comments/{number}","comments_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/181/comments","statuses_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/statuses/a9a61ff212b3c9ddb5d26b1cd7d0bbbe2ef21c81","head":{"label":"CaptainElliott:Fireworks","ref":"Fireworks","sha":"a9a61ff212b3c9ddb5d26b1cd7d0bbbe2ef21c81","user":{"login":"CaptainElliott","id":6588138,"avatar_url":"https://avatars.githubusercontent.com/u/6588138?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainElliott","html_url":"https://github.com/CaptainElliott","followers_url":"https://api.github.com/users/CaptainElliott/followers","following_url":"https://api.github.com/users/CaptainElliott/following{/other_user}","gists_url":"https://api.github.com/users/CaptainElliott/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainElliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainElliott/subscriptions","organizations_url":"https://api.github.com/users/CaptainElliott/orgs","repos_url":"https://api.github.com/users/CaptainElliott/repos","events_url":"https://api.github.com/users/CaptainElliott/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainElliott/received_events","type":"User","site_admin":false},"repo":{"id":30372782,"name":"CardinalPGM","full_name":"CaptainElliott/CardinalPGM","owner":{"login":"CaptainElliott","id":6588138,"avatar_url":"https://avatars.githubusercontent.com/u/6588138?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainElliott","html_url":"https://github.com/CaptainElliott","followers_url":"https://api.github.com/users/CaptainElliott/followers","following_url":"https://api.github.com/users/CaptainElliott/following{/other_user}","gists_url":"https://api.github.com/users/CaptainElliott/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainElliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainElliott/subscriptions","organizations_url":"https://api.github.com/users/CaptainElliott/orgs","repos_url":"https://api.github.com/users/CaptainElliott/repos","events_url":"https://api.github.com/users/CaptainElliott/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainElliott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CaptainElliott/CardinalPGM","description":"A plugin for a better PVP","fork":true,"url":"https://api.github.com/repos/CaptainElliott/CardinalPGM","forks_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/forks","keys_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/teams","hooks_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/hooks","issue_events_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/issues/events{/number}","events_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/events","assignees_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/assignees{/user}","branches_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/branches{/branch}","tags_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/tags","blobs_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/git/refs{/sha}","trees_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/statuses/{sha}","languages_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/languages","stargazers_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/stargazers","contributors_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/contributors","subscribers_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/subscribers","subscription_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/subscription","commits_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/commits{/sha}","git_commits_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/git/commits{/sha}","comments_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/comments{/number}","issue_comment_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/issues/comments/{number}","contents_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/contents/{+path}","compare_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/merges","archive_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/downloads","issues_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/issues{/number}","pulls_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/pulls{/number}","milestones_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/milestones{/number}","notifications_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/labels{/name}","releases_url":"https://api.github.com/repos/CaptainElliott/CardinalPGM/releases{/id}","created_at":"2015-02-05T19:04:00Z","updated_at":"2015-02-06T16:37:57Z","pushed_at":"2015-02-16T16:11:04Z","git_url":"git://github.com/CaptainElliott/CardinalPGM.git","ssh_url":"git@github.com:CaptainElliott/CardinalPGM.git","clone_url":"https://github.com/CaptainElliott/CardinalPGM.git","svn_url":"https://github.com/CaptainElliott/CardinalPGM","homepage":"","size":1292,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"twizmwazin:master","ref":"master","sha":"68cda0d1115af17d73da9e577aadb5411d8687da","user":{"login":"twizmwazin","id":1341797,"avatar_url":"https://avatars.githubusercontent.com/u/1341797?v=3","gravatar_id":"","url":"https://api.github.com/users/twizmwazin","html_url":"https://github.com/twizmwazin","followers_url":"https://api.github.com/users/twizmwazin/followers","following_url":"https://api.github.com/users/twizmwazin/following{/other_user}","gists_url":"https://api.github.com/users/twizmwazin/gists{/gist_id}","starred_url":"https://api.github.com/users/twizmwazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twizmwazin/subscriptions","organizations_url":"https://api.github.com/users/twizmwazin/orgs","repos_url":"https://api.github.com/users/twizmwazin/repos","events_url":"https://api.github.com/users/twizmwazin/events{/privacy}","received_events_url":"https://api.github.com/users/twizmwazin/received_events","type":"User","site_admin":false},"repo":{"id":26194169,"name":"CardinalPGM","full_name":"twizmwazin/CardinalPGM","owner":{"login":"twizmwazin","id":1341797,"avatar_url":"https://avatars.githubusercontent.com/u/1341797?v=3","gravatar_id":"","url":"https://api.github.com/users/twizmwazin","html_url":"https://github.com/twizmwazin","followers_url":"https://api.github.com/users/twizmwazin/followers","following_url":"https://api.github.com/users/twizmwazin/following{/other_user}","gists_url":"https://api.github.com/users/twizmwazin/gists{/gist_id}","starred_url":"https://api.github.com/users/twizmwazin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twizmwazin/subscriptions","organizations_url":"https://api.github.com/users/twizmwazin/orgs","repos_url":"https://api.github.com/users/twizmwazin/repos","events_url":"https://api.github.com/users/twizmwazin/events{/privacy}","received_events_url":"https://api.github.com/users/twizmwazin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twizmwazin/CardinalPGM","description":"A plugin for a better PVP","fork":false,"url":"https://api.github.com/repos/twizmwazin/CardinalPGM","forks_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/forks","keys_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/teams","hooks_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/hooks","issue_events_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/events{/number}","events_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/events","assignees_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/assignees{/user}","branches_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/branches{/branch}","tags_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/tags","blobs_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/git/refs{/sha}","trees_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/statuses/{sha}","languages_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/languages","stargazers_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/stargazers","contributors_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/contributors","subscribers_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/subscribers","subscription_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/subscription","commits_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/commits{/sha}","git_commits_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/git/commits{/sha}","comments_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/comments{/number}","issue_comment_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/comments/{number}","contents_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/contents/{+path}","compare_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/merges","archive_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/downloads","issues_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues{/number}","pulls_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls{/number}","milestones_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/milestones{/number}","notifications_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/labels{/name}","releases_url":"https://api.github.com/repos/twizmwazin/CardinalPGM/releases{/id}","created_at":"2014-11-04T23:48:59Z","updated_at":"2015-02-16T16:23:55Z","pushed_at":"2015-02-16T16:23:55Z","git_url":"git://github.com/twizmwazin/CardinalPGM.git","ssh_url":"git@github.com:twizmwazin/CardinalPGM.git","clone_url":"https://github.com/twizmwazin/CardinalPGM.git","svn_url":"https://github.com/twizmwazin/CardinalPGM","homepage":"","size":3455,"stargazers_count":23,"watchers_count":23,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":8,"forks":19,"open_issues":8,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181"},"html":{"href":"https://github.com/twizmwazin/CardinalPGM/pull/181"},"issue":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/181"},"comments":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/twizmwazin/CardinalPGM/statuses/a9a61ff212b3c9ddb5d26b1cd7d0bbbe2ef21c81"}}}}