{"action":"created","comment":{"url":"https://api.github.com/repos/PaperMC/Paper/pulls/comments/80040696","id":80040696,"diff_hunk":"@@ -0,0 +1,108 @@\n+From e9c1dbbb31f01642641ba1f5da0d390c97235552 Mon Sep 17 00:00:00 2001\n+From: AlphaBlend <whizkid3000@hotmail.com>\n+Date: Wed, 21 Sep 2016 20:40:46 -0700\n+Subject: [PATCH] Add hit entity to ProjectileHitEvent\n+\n+\n+diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java\n+index 37cb17c..2e03161 100644\n+--- a/src/main/java/net/minecraft/server/EntityArrow.java\n++++ b/src/main/java/net/minecraft/server/EntityArrow.java\n+@@ -263,7 +263,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {\n+ \n+     protected void a(MovingObjectPosition movingobjectposition) {\n+         Entity entity = movingobjectposition.entity;\n+-        org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event\n++        org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, entity); // CraftBukkit - Call event Paper - Include entity in movingobjectposition\n+         if (entity != null) {\n+             float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);\n+             int i = MathHelper.f((double) f * this.damage);\n+diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java\n+index 393f26e..7cd3054 100644\n+--- a/src/main/java/net/minecraft/server/EntityFireball.java\n++++ b/src/main/java/net/minecraft/server/EntityFireball.java\n+@@ -99,7 +99,7 @@ public abstract class EntityFireball extends Entity {\n+ \n+                 // CraftBukkit start - Fire ProjectileHitEvent\n+                 if (this.dead) {\n+-                    CraftEventFactory.callProjectileHitEvent(this);\n++                    CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Paper - include entity in movingobjectposition\n+                 }\n+                 // CraftBukkit end\n+             }\n+diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java\n+index 9b71cdd..7222903 100644\n+--- a/src/main/java/net/minecraft/server/EntityFishingHook.java\n++++ b/src/main/java/net/minecraft/server/EntityFishingHook.java\n+@@ -207,7 +207,7 @@ public class EntityFishingHook extends Entity {\n+                 // Paper end\n+ \n+                 if (movingobjectposition != null) {\n+-                    org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event\n++                    org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event Paper - Include entity in movingobjectposition\n+                     if (movingobjectposition.entity != null) {\n+                         this.hooked = movingobjectposition.entity;\n+                         this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1));\n+@@ -459,7 +459,7 @@ public class EntityFishingHook extends Entity {\n+                     if (playerFishEvent.getExpToDrop() > 0) {\n+                         this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop()));\n+                     }\n+-                    // CraftBukkit end                \n++                    // CraftBukkit end\n+                 }\n+ \n+                 i = 1;\n+diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java\n+index 770f130..e95cc24 100644\n+--- a/src/main/java/net/minecraft/server/EntityProjectile.java\n++++ b/src/main/java/net/minecraft/server/EntityProjectile.java\n+@@ -175,7 +175,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {\n+                 this.a(movingobjectposition);\n+                 // CraftBukkit start\n+                 if (this.dead) {\n+-                    org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this);\n++                    org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Paper - include Entity in movingobjectposition\n+                 }\n+                 // CraftBukkit end\n+             }\n+diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java\n+index e39de2b..c92a80b 100644\n+--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java\n++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java\n+@@ -197,7 +197,7 @@ public class CraftEventFactory {\n+     public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, BlockPosition position, EnumDirection direction, ItemStack itemstack, EnumHand hand) {\n+         return callPlayerInteractEvent(who, action, position, direction, itemstack, false, hand);\n+     }\n+-    \n++\n+     public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, BlockPosition position, EnumDirection direction, ItemStack itemstack, boolean cancelledBlock, EnumHand hand) {\n+         Player player = (who == null) ? null : (Player) who.getBukkitEntity();\n+         CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);\n+@@ -652,7 +652,7 @@ public class CraftEventFactory {\n+         if (!event.isCancelled()) {\n+             state.update(true);\n+         }\n+-        \n++\n+         return !event.isCancelled();\n+     }\n+ \n+@@ -782,6 +782,15 @@ public class CraftEventFactory {\n+         return event;\n+     }\n+ \n++    // Paper start\n++    public static ProjectileHitEvent callProjectileHitEvent(Entity entity, Entity hitEntity) {\n++        ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), (hitEntity == null ? null : (org.bukkit.entity.Entity) hitEntity.getBukkitEntity()));","path":"Spigot-Server-Patches/0173-Add-hit-entity-to-ProjectileHitEvent.patch","position":96,"original_position":96,"commit_id":"e98b1065c2652a15acdef2aa71886fe747f37776","original_commit_id":"e98b1065c2652a15acdef2aa71886fe747f37776","user":{"login":"kashike","id":5474071,"avatar_url":"https://avatars.githubusercontent.com/u/5474071?v=3","gravatar_id":"","url":"https://api.github.com/users/kashike","html_url":"https://github.com/kashike","followers_url":"https://api.github.com/users/kashike/followers","following_url":"https://api.github.com/users/kashike/following{/other_user}","gists_url":"https://api.github.com/users/kashike/gists{/gist_id}","starred_url":"https://api.github.com/users/kashike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kashike/subscriptions","organizations_url":"https://api.github.com/users/kashike/orgs","repos_url":"https://api.github.com/users/kashike/repos","events_url":"https://api.github.com/users/kashike/events{/privacy}","received_events_url":"https://api.github.com/users/kashike/received_events","type":"User","site_admin":false},"body":"Why do you have a cast to `org.bukkit.entity.Entity` here? It shouldn't be required.","created_at":"2016-09-22T13:34:16Z","updated_at":"2016-09-22T13:34:17Z","html_url":"https://github.com/PaperMC/Paper/pull/430#discussion_r80040696","pull_request_url":"https://api.github.com/repos/PaperMC/Paper/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/comments/80040696"},"html":{"href":"https://github.com/PaperMC/Paper/pull/430#discussion_r80040696"},"pull_request":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/PaperMC/Paper/pulls/430","id":86275673,"html_url":"https://github.com/PaperMC/Paper/pull/430","diff_url":"https://github.com/PaperMC/Paper/pull/430.diff","patch_url":"https://github.com/PaperMC/Paper/pull/430.patch","issue_url":"https://api.github.com/repos/PaperMC/Paper/issues/430","number":430,"state":"open","locked":false,"title":"Add hit entity to ProjectileHitEvent","user":{"login":"AlphaBlend","id":437096,"avatar_url":"https://avatars.githubusercontent.com/u/437096?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaBlend","html_url":"https://github.com/AlphaBlend","followers_url":"https://api.github.com/users/AlphaBlend/followers","following_url":"https://api.github.com/users/AlphaBlend/following{/other_user}","gists_url":"https://api.github.com/users/AlphaBlend/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaBlend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaBlend/subscriptions","organizations_url":"https://api.github.com/users/AlphaBlend/orgs","repos_url":"https://api.github.com/users/AlphaBlend/repos","events_url":"https://api.github.com/users/AlphaBlend/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaBlend/received_events","type":"User","site_admin":false},"body":"We know what projectile hit something in ProjectileHitEvent but we don't know what it hit. This adds a hit entity so we can grab what was hit.","created_at":"2016-09-22T03:47:23Z","updated_at":"2016-09-22T13:34:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d186064e16f05d8769797f0adf9bffed47548908","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaperMC/Paper/pulls/430/commits","review_comments_url":"https://api.github.com/repos/PaperMC/Paper/pulls/430/comments","review_comment_url":"https://api.github.com/repos/PaperMC/Paper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaperMC/Paper/issues/430/comments","statuses_url":"https://api.github.com/repos/PaperMC/Paper/statuses/e98b1065c2652a15acdef2aa71886fe747f37776","head":{"label":"AlphaBlend:ProjectileHitEventModification","ref":"ProjectileHitEventModification","sha":"e98b1065c2652a15acdef2aa71886fe747f37776","user":{"login":"AlphaBlend","id":437096,"avatar_url":"https://avatars.githubusercontent.com/u/437096?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaBlend","html_url":"https://github.com/AlphaBlend","followers_url":"https://api.github.com/users/AlphaBlend/followers","following_url":"https://api.github.com/users/AlphaBlend/following{/other_user}","gists_url":"https://api.github.com/users/AlphaBlend/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaBlend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaBlend/subscriptions","organizations_url":"https://api.github.com/users/AlphaBlend/orgs","repos_url":"https://api.github.com/users/AlphaBlend/repos","events_url":"https://api.github.com/users/AlphaBlend/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaBlend/received_events","type":"User","site_admin":false},"repo":{"id":66005719,"name":"Paper","full_name":"AlphaBlend/Paper","owner":{"login":"AlphaBlend","id":437096,"avatar_url":"https://avatars.githubusercontent.com/u/437096?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaBlend","html_url":"https://github.com/AlphaBlend","followers_url":"https://api.github.com/users/AlphaBlend/followers","following_url":"https://api.github.com/users/AlphaBlend/following{/other_user}","gists_url":"https://api.github.com/users/AlphaBlend/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaBlend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaBlend/subscriptions","organizations_url":"https://api.github.com/users/AlphaBlend/orgs","repos_url":"https://api.github.com/users/AlphaBlend/repos","events_url":"https://api.github.com/users/AlphaBlend/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaBlend/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlphaBlend/Paper","description":"High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.","fork":true,"url":"https://api.github.com/repos/AlphaBlend/Paper","forks_url":"https://api.github.com/repos/AlphaBlend/Paper/forks","keys_url":"https://api.github.com/repos/AlphaBlend/Paper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlphaBlend/Paper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlphaBlend/Paper/teams","hooks_url":"https://api.github.com/repos/AlphaBlend/Paper/hooks","issue_events_url":"https://api.github.com/repos/AlphaBlend/Paper/issues/events{/number}","events_url":"https://api.github.com/repos/AlphaBlend/Paper/events","assignees_url":"https://api.github.com/repos/AlphaBlend/Paper/assignees{/user}","branches_url":"https://api.github.com/repos/AlphaBlend/Paper/branches{/branch}","tags_url":"https://api.github.com/repos/AlphaBlend/Paper/tags","blobs_url":"https://api.github.com/repos/AlphaBlend/Paper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlphaBlend/Paper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlphaBlend/Paper/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlphaBlend/Paper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlphaBlend/Paper/statuses/{sha}","languages_url":"https://api.github.com/repos/AlphaBlend/Paper/languages","stargazers_url":"https://api.github.com/repos/AlphaBlend/Paper/stargazers","contributors_url":"https://api.github.com/repos/AlphaBlend/Paper/contributors","subscribers_url":"https://api.github.com/repos/AlphaBlend/Paper/subscribers","subscription_url":"https://api.github.com/repos/AlphaBlend/Paper/subscription","commits_url":"https://api.github.com/repos/AlphaBlend/Paper/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlphaBlend/Paper/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlphaBlend/Paper/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlphaBlend/Paper/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlphaBlend/Paper/contents/{+path}","compare_url":"https://api.github.com/repos/AlphaBlend/Paper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlphaBlend/Paper/merges","archive_url":"https://api.github.com/repos/AlphaBlend/Paper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlphaBlend/Paper/downloads","issues_url":"https://api.github.com/repos/AlphaBlend/Paper/issues{/number}","pulls_url":"https://api.github.com/repos/AlphaBlend/Paper/pulls{/number}","milestones_url":"https://api.github.com/repos/AlphaBlend/Paper/milestones{/number}","notifications_url":"https://api.github.com/repos/AlphaBlend/Paper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlphaBlend/Paper/labels{/name}","releases_url":"https://api.github.com/repos/AlphaBlend/Paper/releases{/id}","deployments_url":"https://api.github.com/repos/AlphaBlend/Paper/deployments","created_at":"2016-08-18T14:51:01Z","updated_at":"2016-08-18T14:51:03Z","pushed_at":"2016-09-22T03:44:10Z","git_url":"git://github.com/AlphaBlend/Paper.git","ssh_url":"git@github.com:AlphaBlend/Paper.git","clone_url":"https://github.com/AlphaBlend/Paper.git","svn_url":"https://github.com/AlphaBlend/Paper","homepage":"https://aquifermc.org/","size":6733,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"PaperMC:master","ref":"master","sha":"bd4ececc82508778cc67a5e7002bae0526eefc12","user":{"login":"PaperMC","id":7608950,"avatar_url":"https://avatars.githubusercontent.com/u/7608950?v=3","gravatar_id":"","url":"https://api.github.com/users/PaperMC","html_url":"https://github.com/PaperMC","followers_url":"https://api.github.com/users/PaperMC/followers","following_url":"https://api.github.com/users/PaperMC/following{/other_user}","gists_url":"https://api.github.com/users/PaperMC/gists{/gist_id}","starred_url":"https://api.github.com/users/PaperMC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaperMC/subscriptions","organizations_url":"https://api.github.com/users/PaperMC/orgs","repos_url":"https://api.github.com/users/PaperMC/repos","events_url":"https://api.github.com/users/PaperMC/events{/privacy}","received_events_url":"https://api.github.com/users/PaperMC/received_events","type":"Organization","site_admin":false},"repo":{"id":50160261,"name":"Paper","full_name":"PaperMC/Paper","owner":{"login":"PaperMC","id":7608950,"avatar_url":"https://avatars.githubusercontent.com/u/7608950?v=3","gravatar_id":"","url":"https://api.github.com/users/PaperMC","html_url":"https://github.com/PaperMC","followers_url":"https://api.github.com/users/PaperMC/followers","following_url":"https://api.github.com/users/PaperMC/following{/other_user}","gists_url":"https://api.github.com/users/PaperMC/gists{/gist_id}","starred_url":"https://api.github.com/users/PaperMC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaperMC/subscriptions","organizations_url":"https://api.github.com/users/PaperMC/orgs","repos_url":"https://api.github.com/users/PaperMC/repos","events_url":"https://api.github.com/users/PaperMC/events{/privacy}","received_events_url":"https://api.github.com/users/PaperMC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaperMC/Paper","description":"High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.","fork":false,"url":"https://api.github.com/repos/PaperMC/Paper","forks_url":"https://api.github.com/repos/PaperMC/Paper/forks","keys_url":"https://api.github.com/repos/PaperMC/Paper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaperMC/Paper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaperMC/Paper/teams","hooks_url":"https://api.github.com/repos/PaperMC/Paper/hooks","issue_events_url":"https://api.github.com/repos/PaperMC/Paper/issues/events{/number}","events_url":"https://api.github.com/repos/PaperMC/Paper/events","assignees_url":"https://api.github.com/repos/PaperMC/Paper/assignees{/user}","branches_url":"https://api.github.com/repos/PaperMC/Paper/branches{/branch}","tags_url":"https://api.github.com/repos/PaperMC/Paper/tags","blobs_url":"https://api.github.com/repos/PaperMC/Paper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaperMC/Paper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaperMC/Paper/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaperMC/Paper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaperMC/Paper/statuses/{sha}","languages_url":"https://api.github.com/repos/PaperMC/Paper/languages","stargazers_url":"https://api.github.com/repos/PaperMC/Paper/stargazers","contributors_url":"https://api.github.com/repos/PaperMC/Paper/contributors","subscribers_url":"https://api.github.com/repos/PaperMC/Paper/subscribers","subscription_url":"https://api.github.com/repos/PaperMC/Paper/subscription","commits_url":"https://api.github.com/repos/PaperMC/Paper/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaperMC/Paper/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaperMC/Paper/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaperMC/Paper/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaperMC/Paper/contents/{+path}","compare_url":"https://api.github.com/repos/PaperMC/Paper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaperMC/Paper/merges","archive_url":"https://api.github.com/repos/PaperMC/Paper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaperMC/Paper/downloads","issues_url":"https://api.github.com/repos/PaperMC/Paper/issues{/number}","pulls_url":"https://api.github.com/repos/PaperMC/Paper/pulls{/number}","milestones_url":"https://api.github.com/repos/PaperMC/Paper/milestones{/number}","notifications_url":"https://api.github.com/repos/PaperMC/Paper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaperMC/Paper/labels{/name}","releases_url":"https://api.github.com/repos/PaperMC/Paper/releases{/id}","deployments_url":"https://api.github.com/repos/PaperMC/Paper/deployments","created_at":"2016-01-22T05:40:19Z","updated_at":"2016-09-20T10:48:50Z","pushed_at":"2016-09-22T03:56:49Z","git_url":"git://github.com/PaperMC/Paper.git","ssh_url":"git@github.com:PaperMC/Paper.git","clone_url":"https://github.com/PaperMC/Paper.git","svn_url":"https://github.com/PaperMC/Paper","homepage":"https://aquifermc.org/","size":7881,"stargazers_count":115,"watchers_count":115,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":35,"forks":77,"open_issues":35,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/430"},"html":{"href":"https://github.com/PaperMC/Paper/pull/430"},"issue":{"href":"https://api.github.com/repos/PaperMC/Paper/issues/430"},"comments":{"href":"https://api.github.com/repos/PaperMC/Paper/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaperMC/Paper/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/PaperMC/Paper/statuses/e98b1065c2652a15acdef2aa71886fe747f37776"}}}}
{"actor":{"display_login":"kashike"}}