{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments/22505587","id":22505587,"diff_hunk":"@@ -0,0 +1,122 @@\n+/*\n+ * This file is part of Sponge, licensed under the MIT License (MIT).\n+ *\n+ * Copyright (c) SpongePowered.org <http://www.spongepowered.org>\n+ * Copyright (c) contributors\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package org.spongepowered.mod.mixin.entity.living;\n+\n+import net.minecraft.entity.Entity;\n+import net.minecraft.entity.EntityLivingBase;\n+import net.minecraft.entity.item.EntityBoat;\n+import net.minecraft.util.AxisAlignedBB;\n+import net.minecraft.world.World;\n+import org.spongepowered.api.entity.vehicle.Boat;\n+import org.spongepowered.api.util.annotation.NonnullByDefault;\n+import org.spongepowered.asm.mixin.Mixin;\n+import org.spongepowered.asm.mixin.Overwrite;\n+import org.spongepowered.asm.mixin.Shadow;\n+import org.spongepowered.asm.mixin.injection.At;\n+import org.spongepowered.asm.mixin.injection.Inject;\n+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;\n+\n+@NonnullByDefault\n+@Mixin(EntityBoat.class)\n+public abstract class MixinEntityBoat extends Entity implements Boat {\n+\n+    private double maxSpeed = 0.4D;\n+    private boolean moveOnLand = false;\n+    private double occupiedDecelerationSpeed;\n+    private double unoccupiedDecelerationSpeed;\n+\n+    // this method overwrites vanilla boat behavior to allow for a custom max speed\n+    @Overwrite\n+    public void updateRiderPosition() {\n+        if (this.riddenByEntity != null) {\n+            double d0 = Math.cos(this.rotationYaw * Math.PI / 180.0D) * maxSpeed;\n+            double d1 = Math.sin(this.rotationYaw * 3.141592653589793D / 180.0D) * maxSpeed;\n+            this.riddenByEntity.setPosition(this.posX + d0, this.posY + getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + d1);\n+        }\n+    }\n+\n+    @Inject(method = \"onUpdate()V\", at = @At(value = \"INVOKE\", target = \"net.minecraft.entity.Entity.moveEntity(DDD)V\"))\n+    public void implementLandBoats(CallbackInfo ci){\n+        if (this.onGround && this.moveOnLand){\n+            this.motionX /= 0.5D;\n+            this.motionY /= 0.5D;\n+            this.motionZ /= 0.5D;\n+        }\n+    }\n+\n+    // this code is injected three times, but the first conditional implicitly fails at the second two locations","path":"src/main/java/org/spongepowered/mod/mixin/entity/living/MixinEntityBoat.java","position":69,"original_position":69,"commit_id":"549f5daee76359263d39d3168bf6e48eea268cce","original_commit_id":"549f5daee76359263d39d3168bf6e48eea268cce","user":{"login":"mproncace","id":2825606,"avatar_url":"https://avatars.githubusercontent.com/u/2825606?v=3","gravatar_id":"","url":"https://api.github.com/users/mproncace","html_url":"https://github.com/mproncace","followers_url":"https://api.github.com/users/mproncace/followers","following_url":"https://api.github.com/users/mproncace/following{/other_user}","gists_url":"https://api.github.com/users/mproncace/gists{/gist_id}","starred_url":"https://api.github.com/users/mproncace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mproncace/subscriptions","organizations_url":"https://api.github.com/users/mproncace/orgs","repos_url":"https://api.github.com/users/mproncace/repos","events_url":"https://api.github.com/users/mproncace/events{/privacy}","received_events_url":"https://api.github.com/users/mproncace/received_events","type":"User","site_admin":false},"body":"Ah, wasn't aware of that. I'll push a new commit momentarily.","created_at":"2015-01-06T02:50:41Z","updated_at":"2015-01-06T02:50:41Z","html_url":"https://github.com/SpongePowered/Sponge/pull/123#discussion_r22505587","pull_request_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments/22505587"},"html":{"href":"https://github.com/SpongePowered/Sponge/pull/123#discussion_r22505587"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123","id":26866408,"html_url":"https://github.com/SpongePowered/Sponge/pull/123","diff_url":"https://github.com/SpongePowered/Sponge/pull/123.diff","patch_url":"https://github.com/SpongePowered/Sponge/pull/123.patch","issue_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/123","number":123,"state":"open","locked":false,"title":"Implement boat entity","user":{"login":"mproncace","id":2825606,"avatar_url":"https://avatars.githubusercontent.com/u/2825606?v=3","gravatar_id":"","url":"https://api.github.com/users/mproncace","html_url":"https://github.com/mproncace","followers_url":"https://api.github.com/users/mproncace/followers","following_url":"https://api.github.com/users/mproncace/following{/other_user}","gists_url":"https://api.github.com/users/mproncace/gists{/gist_id}","starred_url":"https://api.github.com/users/mproncace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mproncace/subscriptions","organizations_url":"https://api.github.com/users/mproncace/orgs","repos_url":"https://api.github.com/users/mproncace/repos","events_url":"https://api.github.com/users/mproncace/events{/privacy}","received_events_url":"https://api.github.com/users/mproncace/received_events","type":"User","site_admin":false},"body":"This commit implements the boat entity and injects necessary vanilla modifications to support API functions.","created_at":"2015-01-06T02:33:27Z","updated_at":"2015-01-06T02:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d940d45aff2fd7aacaf7227311d6a7090aa6871","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments/{number}","comments_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/123/comments","statuses_url":"https://api.github.com/repos/SpongePowered/Sponge/statuses/549f5daee76359263d39d3168bf6e48eea268cce","head":{"label":"mproncace:feature-5","ref":"feature-5","sha":"549f5daee76359263d39d3168bf6e48eea268cce","user":{"login":"mproncace","id":2825606,"avatar_url":"https://avatars.githubusercontent.com/u/2825606?v=3","gravatar_id":"","url":"https://api.github.com/users/mproncace","html_url":"https://github.com/mproncace","followers_url":"https://api.github.com/users/mproncace/followers","following_url":"https://api.github.com/users/mproncace/following{/other_user}","gists_url":"https://api.github.com/users/mproncace/gists{/gist_id}","starred_url":"https://api.github.com/users/mproncace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mproncace/subscriptions","organizations_url":"https://api.github.com/users/mproncace/orgs","repos_url":"https://api.github.com/users/mproncace/repos","events_url":"https://api.github.com/users/mproncace/events{/privacy}","received_events_url":"https://api.github.com/users/mproncace/received_events","type":"User","site_admin":false},"repo":{"id":23857403,"name":"Sponge","full_name":"mproncace/Sponge","owner":{"login":"mproncace","id":2825606,"avatar_url":"https://avatars.githubusercontent.com/u/2825606?v=3","gravatar_id":"","url":"https://api.github.com/users/mproncace","html_url":"https://github.com/mproncace","followers_url":"https://api.github.com/users/mproncace/followers","following_url":"https://api.github.com/users/mproncace/following{/other_user}","gists_url":"https://api.github.com/users/mproncace/gists{/gist_id}","starred_url":"https://api.github.com/users/mproncace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mproncace/subscriptions","organizations_url":"https://api.github.com/users/mproncace/orgs","repos_url":"https://api.github.com/users/mproncace/repos","events_url":"https://api.github.com/users/mproncace/events{/privacy}","received_events_url":"https://api.github.com/users/mproncace/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mproncace/Sponge","description":"A Forge implementation of the Sponge API","fork":true,"url":"https://api.github.com/repos/mproncace/Sponge","forks_url":"https://api.github.com/repos/mproncace/Sponge/forks","keys_url":"https://api.github.com/repos/mproncace/Sponge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mproncace/Sponge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mproncace/Sponge/teams","hooks_url":"https://api.github.com/repos/mproncace/Sponge/hooks","issue_events_url":"https://api.github.com/repos/mproncace/Sponge/issues/events{/number}","events_url":"https://api.github.com/repos/mproncace/Sponge/events","assignees_url":"https://api.github.com/repos/mproncace/Sponge/assignees{/user}","branches_url":"https://api.github.com/repos/mproncace/Sponge/branches{/branch}","tags_url":"https://api.github.com/repos/mproncace/Sponge/tags","blobs_url":"https://api.github.com/repos/mproncace/Sponge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mproncace/Sponge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mproncace/Sponge/git/refs{/sha}","trees_url":"https://api.github.com/repos/mproncace/Sponge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mproncace/Sponge/statuses/{sha}","languages_url":"https://api.github.com/repos/mproncace/Sponge/languages","stargazers_url":"https://api.github.com/repos/mproncace/Sponge/stargazers","contributors_url":"https://api.github.com/repos/mproncace/Sponge/contributors","subscribers_url":"https://api.github.com/repos/mproncace/Sponge/subscribers","subscription_url":"https://api.github.com/repos/mproncace/Sponge/subscription","commits_url":"https://api.github.com/repos/mproncace/Sponge/commits{/sha}","git_commits_url":"https://api.github.com/repos/mproncace/Sponge/git/commits{/sha}","comments_url":"https://api.github.com/repos/mproncace/Sponge/comments{/number}","issue_comment_url":"https://api.github.com/repos/mproncace/Sponge/issues/comments/{number}","contents_url":"https://api.github.com/repos/mproncace/Sponge/contents/{+path}","compare_url":"https://api.github.com/repos/mproncace/Sponge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mproncace/Sponge/merges","archive_url":"https://api.github.com/repos/mproncace/Sponge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mproncace/Sponge/downloads","issues_url":"https://api.github.com/repos/mproncace/Sponge/issues{/number}","pulls_url":"https://api.github.com/repos/mproncace/Sponge/pulls{/number}","milestones_url":"https://api.github.com/repos/mproncace/Sponge/milestones{/number}","notifications_url":"https://api.github.com/repos/mproncace/Sponge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mproncace/Sponge/labels{/name}","releases_url":"https://api.github.com/repos/mproncace/Sponge/releases{/id}","created_at":"2014-09-10T02:10:26Z","updated_at":"2015-01-05T19:01:45Z","pushed_at":"2015-01-06T02:32:35Z","git_url":"git://github.com/mproncace/Sponge.git","ssh_url":"git@github.com:mproncace/Sponge.git","clone_url":"https://github.com/mproncace/Sponge.git","svn_url":"https://github.com/mproncace/Sponge","homepage":"","size":810,"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":"SpongePowered:master","ref":"master","sha":"57b3b465c25897223f1afc9e55e14165ecaad672","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":23774298,"name":"Sponge","full_name":"SpongePowered/Sponge","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/Sponge","description":"A Forge mod that implements SpongeAPI","fork":false,"url":"https://api.github.com/repos/SpongePowered/Sponge","forks_url":"https://api.github.com/repos/SpongePowered/Sponge/forks","keys_url":"https://api.github.com/repos/SpongePowered/Sponge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/Sponge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/Sponge/teams","hooks_url":"https://api.github.com/repos/SpongePowered/Sponge/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/Sponge/events","assignees_url":"https://api.github.com/repos/SpongePowered/Sponge/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/Sponge/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/Sponge/tags","blobs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/Sponge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/Sponge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/Sponge/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/Sponge/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/Sponge/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/Sponge/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/Sponge/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/Sponge/subscription","commits_url":"https://api.github.com/repos/SpongePowered/Sponge/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/Sponge/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/Sponge/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/comments/{number}","contents_url":"https://api.github.com/repos/SpongePowered/Sponge/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/Sponge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/Sponge/merges","archive_url":"https://api.github.com/repos/SpongePowered/Sponge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/Sponge/downloads","issues_url":"https://api.github.com/repos/SpongePowered/Sponge/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/Sponge/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/Sponge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/Sponge/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/Sponge/releases{/id}","created_at":"2014-09-08T00:01:33Z","updated_at":"2015-01-05T16:19:45Z","pushed_at":"2015-01-06T00:16:07Z","git_url":"git://github.com/SpongePowered/Sponge.git","ssh_url":"git@github.com:SpongePowered/Sponge.git","clone_url":"https://github.com/SpongePowered/Sponge.git","svn_url":"https://github.com/SpongePowered/Sponge","homepage":"http://www.spongepowered.org/","size":3696,"stargazers_count":693,"watchers_count":693,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":18,"forks":283,"open_issues":18,"watchers":693,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123"},"html":{"href":"https://github.com/SpongePowered/Sponge/pull/123"},"issue":{"href":"https://api.github.com/repos/SpongePowered/Sponge/issues/123"},"comments":{"href":"https://api.github.com/repos/SpongePowered/Sponge/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/Sponge/statuses/549f5daee76359263d39d3168bf6e48eea268cce"}}}}