{"action":"created","comment":{"url":"https://api.github.com/repos/runelite/runelite/pulls/comments/186249932","pull_request_review_id":117801392,"id":186249932,"diff_hunk":"@@ -0,0 +1,194 @@\n+/*\n+ * Copyright (c) 2018, Dreyri <https://github.com/Dreyri>\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice, this\n+ *    list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ *    this list of conditions and the following disclaimer in the documentation\n+ *    and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+package net.runelite.api;\n+\n+import lombok.Getter;\n+import lombok.Setter;\n+import net.runelite.api.coords.WorldPoint;\n+\n+import java.util.ArrayList;\n+import java.util.Iterator;\n+import java.util.List;\n+\n+/**\n+ * stores information about freezes.\n+ * queuedTicks can vary depending on whether we assumed we have pid or not. when others get frozen we always assume\n+ * we have pid, otherwise refreezes could happen whilst it shows immunity and inaccurate information will display\n+ */\n+public class FreezeInfo\n+{\n+\t/**\n+\t * list of freezes which ave been queued, can vary depending on pid or not.\n+\t * We assume we always have pid against other players and players never have pid against npcs\n+\t */\n+\t@Getter\n+\tprivate List<QueuedFreeze> queuedFreezes;\n+\n+\t/**\n+\t * the remaining frozen ticks\n+\t */\n+\t@Getter\n+\t@Setter\n+\tprivate int frozen;\n+\n+\t/**\n+\t * the remaining immune\n+\t */\n+\t@Getter\n+\t@Setter\n+\tprivate int immune;\n+\n+\t/**\n+\t * the type of freeze applied. To know which sprite to display\n+\t * null upon initialisation and when no freeze is activate.\n+\t * This value will also be null whilst immune and if this type is set during immunity\n+\t * it's for the queued freeze.\n+\t * As a result this value should never be null when the State is either QUEUED or FROZEN\n+\t */\n+\t@Getter\n+\t@Setter\n+\tprivate FreezeType type;\n+\n+\t/**\n+\t * position we are frozen at, if we move from this point the freeze is automatically cancelled and immunity applied\n+\t */\n+\t@Getter\n+\tprivate WorldPoint position;\n+\n+\tpublic FreezeInfo()\n+\t{\n+\t\tthis.queuedFreezes = new ArrayList<>();","path":"runelite-api/src/main/java/net/runelite/api/FreezeInfo.java","position":82,"original_position":82,"commit_id":"f4ba42e46ddeda37e19e1132579a5d109fca1ef1","original_commit_id":"f4ba42e46ddeda37e19e1132579a5d109fca1ef1","user":{"login":"LeviSchuck","id":245911,"avatar_url":"https://avatars0.githubusercontent.com/u/245911?v=4","gravatar_id":"","url":"https://api.github.com/users/LeviSchuck","html_url":"https://github.com/LeviSchuck","followers_url":"https://api.github.com/users/LeviSchuck/followers","following_url":"https://api.github.com/users/LeviSchuck/following{/other_user}","gists_url":"https://api.github.com/users/LeviSchuck/gists{/gist_id}","starred_url":"https://api.github.com/users/LeviSchuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeviSchuck/subscriptions","organizations_url":"https://api.github.com/users/LeviSchuck/orgs","repos_url":"https://api.github.com/users/LeviSchuck/repos","events_url":"https://api.github.com/users/LeviSchuck/events{/privacy}","received_events_url":"https://api.github.com/users/LeviSchuck/received_events","type":"User","site_admin":false},"body":"Just set these on the same line as when you declare. You aren't doing any sort of computation or build logic here. \r\n\r\nMost RL code uses lombok generated constructors. This deviates from that without a good reason.","created_at":"2018-05-05T02:21:30Z","updated_at":"2018-05-05T02:38:52Z","html_url":"https://github.com/runelite/runelite/pull/574#discussion_r186249932","pull_request_url":"https://api.github.com/repos/runelite/runelite/pulls/574","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/runelite/runelite/pulls/comments/186249932"},"html":{"href":"https://github.com/runelite/runelite/pull/574#discussion_r186249932"},"pull_request":{"href":"https://api.github.com/repos/runelite/runelite/pulls/574"}}},"pull_request":{"url":"https://api.github.com/repos/runelite/runelite/pulls/574","id":168872608,"html_url":"https://github.com/runelite/runelite/pull/574","diff_url":"https://github.com/runelite/runelite/pull/574.diff","patch_url":"https://github.com/runelite/runelite/pull/574.patch","issue_url":"https://api.github.com/repos/runelite/runelite/issues/574","number":574,"state":"open","locked":false,"title":"FreezeInfo for Actors","user":{"login":"Dreyri","id":503776,"avatar_url":"https://avatars2.githubusercontent.com/u/503776?v=4","gravatar_id":"","url":"https://api.github.com/users/Dreyri","html_url":"https://github.com/Dreyri","followers_url":"https://api.github.com/users/Dreyri/followers","following_url":"https://api.github.com/users/Dreyri/following{/other_user}","gists_url":"https://api.github.com/users/Dreyri/gists{/gist_id}","starred_url":"https://api.github.com/users/Dreyri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dreyri/subscriptions","organizations_url":"https://api.github.com/users/Dreyri/orgs","repos_url":"https://api.github.com/users/Dreyri/repos","events_url":"https://api.github.com/users/Dreyri/events{/privacy}","received_events_url":"https://api.github.com/users/Dreyri/received_events","type":"User","site_admin":false},"body":"The FreezeInfo object injected into Actors stores the following:\r\n- type of freeze (burst, barrage, etc)\r\n- ticks of freeze remaining\r\n- ticks of immunity remaining\r\n- position where the actor was frozen\r\n\r\nThe information stored should be 100% accurate for NPCs.\r\n\r\nFor Players the information can be off by 1 tick because of PID. The chat message for for freezes cannot prevent this from happening because it has the same tick discrepancy.\r\n\r\nTo account for this issue we assume the player being targeted never has PID so the freeze happens at the earliest possible moment, as a result the player could potentially be frozen for an additional tick after the timer runs out and the same for immunity being 1 tick longer than shown.\r\n\r\nThe reason for making this assumption rather than the other way around is that in this case a freeze can be registered whilst the target was not actually frozen but this will automatically be cancelled by the target moving position, had we taken the other way around a situation could occur where a freeze is not registered because we thought immunity would last 1 tick longer, this seems like a worse outcome to me.","created_at":"2018-02-13T15:19:36Z","updated_at":"2018-05-05T02:38:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9d2c6e055bde3b6ae2aa6b6e9e0892b62aba983","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":771846940,"url":"https://api.github.com/repos/runelite/runelite/labels/feature-request","name":"feature-request","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/runelite/runelite/pulls/574/commits","review_comments_url":"https://api.github.com/repos/runelite/runelite/pulls/574/comments","review_comment_url":"https://api.github.com/repos/runelite/runelite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/runelite/runelite/issues/574/comments","statuses_url":"https://api.github.com/repos/runelite/runelite/statuses/f4ba42e46ddeda37e19e1132579a5d109fca1ef1","head":{"label":"Dreyri:freeze","ref":"freeze","sha":"f4ba42e46ddeda37e19e1132579a5d109fca1ef1","user":{"login":"Dreyri","id":503776,"avatar_url":"https://avatars2.githubusercontent.com/u/503776?v=4","gravatar_id":"","url":"https://api.github.com/users/Dreyri","html_url":"https://github.com/Dreyri","followers_url":"https://api.github.com/users/Dreyri/followers","following_url":"https://api.github.com/users/Dreyri/following{/other_user}","gists_url":"https://api.github.com/users/Dreyri/gists{/gist_id}","starred_url":"https://api.github.com/users/Dreyri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dreyri/subscriptions","organizations_url":"https://api.github.com/users/Dreyri/orgs","repos_url":"https://api.github.com/users/Dreyri/repos","events_url":"https://api.github.com/users/Dreyri/events{/privacy}","received_events_url":"https://api.github.com/users/Dreyri/received_events","type":"User","site_admin":false},"repo":{"id":116577766,"name":"runelite","full_name":"Dreyri/runelite","owner":{"login":"Dreyri","id":503776,"avatar_url":"https://avatars2.githubusercontent.com/u/503776?v=4","gravatar_id":"","url":"https://api.github.com/users/Dreyri","html_url":"https://github.com/Dreyri","followers_url":"https://api.github.com/users/Dreyri/followers","following_url":"https://api.github.com/users/Dreyri/following{/other_user}","gists_url":"https://api.github.com/users/Dreyri/gists{/gist_id}","starred_url":"https://api.github.com/users/Dreyri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dreyri/subscriptions","organizations_url":"https://api.github.com/users/Dreyri/orgs","repos_url":"https://api.github.com/users/Dreyri/repos","events_url":"https://api.github.com/users/Dreyri/events{/privacy}","received_events_url":"https://api.github.com/users/Dreyri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dreyri/runelite","description":"Open source Old School RuneScape client","fork":true,"url":"https://api.github.com/repos/Dreyri/runelite","forks_url":"https://api.github.com/repos/Dreyri/runelite/forks","keys_url":"https://api.github.com/repos/Dreyri/runelite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dreyri/runelite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dreyri/runelite/teams","hooks_url":"https://api.github.com/repos/Dreyri/runelite/hooks","issue_events_url":"https://api.github.com/repos/Dreyri/runelite/issues/events{/number}","events_url":"https://api.github.com/repos/Dreyri/runelite/events","assignees_url":"https://api.github.com/repos/Dreyri/runelite/assignees{/user}","branches_url":"https://api.github.com/repos/Dreyri/runelite/branches{/branch}","tags_url":"https://api.github.com/repos/Dreyri/runelite/tags","blobs_url":"https://api.github.com/repos/Dreyri/runelite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dreyri/runelite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dreyri/runelite/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dreyri/runelite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dreyri/runelite/statuses/{sha}","languages_url":"https://api.github.com/repos/Dreyri/runelite/languages","stargazers_url":"https://api.github.com/repos/Dreyri/runelite/stargazers","contributors_url":"https://api.github.com/repos/Dreyri/runelite/contributors","subscribers_url":"https://api.github.com/repos/Dreyri/runelite/subscribers","subscription_url":"https://api.github.com/repos/Dreyri/runelite/subscription","commits_url":"https://api.github.com/repos/Dreyri/runelite/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dreyri/runelite/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dreyri/runelite/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dreyri/runelite/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dreyri/runelite/contents/{+path}","compare_url":"https://api.github.com/repos/Dreyri/runelite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dreyri/runelite/merges","archive_url":"https://api.github.com/repos/Dreyri/runelite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dreyri/runelite/downloads","issues_url":"https://api.github.com/repos/Dreyri/runelite/issues{/number}","pulls_url":"https://api.github.com/repos/Dreyri/runelite/pulls{/number}","milestones_url":"https://api.github.com/repos/Dreyri/runelite/milestones{/number}","notifications_url":"https://api.github.com/repos/Dreyri/runelite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dreyri/runelite/labels{/name}","releases_url":"https://api.github.com/repos/Dreyri/runelite/releases{/id}","deployments_url":"https://api.github.com/repos/Dreyri/runelite/deployments","created_at":"2018-01-07T15:43:56Z","updated_at":"2018-04-28T19:38:33Z","pushed_at":"2018-04-28T20:29:52Z","git_url":"git://github.com/Dreyri/runelite.git","ssh_url":"git@github.com:Dreyri/runelite.git","clone_url":"https://github.com/Dreyri/runelite.git","svn_url":"https://github.com/Dreyri/runelite","homepage":"https://runelite.net","size":38634,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"runelite:master","ref":"master","sha":"0c26b18a076a4641644a07b94ca3b53f100590c4","user":{"login":"runelite","id":13814776,"avatar_url":"https://avatars1.githubusercontent.com/u/13814776?v=4","gravatar_id":"","url":"https://api.github.com/users/runelite","html_url":"https://github.com/runelite","followers_url":"https://api.github.com/users/runelite/followers","following_url":"https://api.github.com/users/runelite/following{/other_user}","gists_url":"https://api.github.com/users/runelite/gists{/gist_id}","starred_url":"https://api.github.com/users/runelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runelite/subscriptions","organizations_url":"https://api.github.com/users/runelite/orgs","repos_url":"https://api.github.com/users/runelite/repos","events_url":"https://api.github.com/users/runelite/events{/privacy}","received_events_url":"https://api.github.com/users/runelite/received_events","type":"Organization","site_admin":false},"repo":{"id":57461213,"name":"runelite","full_name":"runelite/runelite","owner":{"login":"runelite","id":13814776,"avatar_url":"https://avatars1.githubusercontent.com/u/13814776?v=4","gravatar_id":"","url":"https://api.github.com/users/runelite","html_url":"https://github.com/runelite","followers_url":"https://api.github.com/users/runelite/followers","following_url":"https://api.github.com/users/runelite/following{/other_user}","gists_url":"https://api.github.com/users/runelite/gists{/gist_id}","starred_url":"https://api.github.com/users/runelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runelite/subscriptions","organizations_url":"https://api.github.com/users/runelite/orgs","repos_url":"https://api.github.com/users/runelite/repos","events_url":"https://api.github.com/users/runelite/events{/privacy}","received_events_url":"https://api.github.com/users/runelite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/runelite/runelite","description":"Open source Old School RuneScape client","fork":false,"url":"https://api.github.com/repos/runelite/runelite","forks_url":"https://api.github.com/repos/runelite/runelite/forks","keys_url":"https://api.github.com/repos/runelite/runelite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/runelite/runelite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/runelite/runelite/teams","hooks_url":"https://api.github.com/repos/runelite/runelite/hooks","issue_events_url":"https://api.github.com/repos/runelite/runelite/issues/events{/number}","events_url":"https://api.github.com/repos/runelite/runelite/events","assignees_url":"https://api.github.com/repos/runelite/runelite/assignees{/user}","branches_url":"https://api.github.com/repos/runelite/runelite/branches{/branch}","tags_url":"https://api.github.com/repos/runelite/runelite/tags","blobs_url":"https://api.github.com/repos/runelite/runelite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/runelite/runelite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/runelite/runelite/git/refs{/sha}","trees_url":"https://api.github.com/repos/runelite/runelite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/runelite/runelite/statuses/{sha}","languages_url":"https://api.github.com/repos/runelite/runelite/languages","stargazers_url":"https://api.github.com/repos/runelite/runelite/stargazers","contributors_url":"https://api.github.com/repos/runelite/runelite/contributors","subscribers_url":"https://api.github.com/repos/runelite/runelite/subscribers","subscription_url":"https://api.github.com/repos/runelite/runelite/subscription","commits_url":"https://api.github.com/repos/runelite/runelite/commits{/sha}","git_commits_url":"https://api.github.com/repos/runelite/runelite/git/commits{/sha}","comments_url":"https://api.github.com/repos/runelite/runelite/comments{/number}","issue_comment_url":"https://api.github.com/repos/runelite/runelite/issues/comments{/number}","contents_url":"https://api.github.com/repos/runelite/runelite/contents/{+path}","compare_url":"https://api.github.com/repos/runelite/runelite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/runelite/runelite/merges","archive_url":"https://api.github.com/repos/runelite/runelite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/runelite/runelite/downloads","issues_url":"https://api.github.com/repos/runelite/runelite/issues{/number}","pulls_url":"https://api.github.com/repos/runelite/runelite/pulls{/number}","milestones_url":"https://api.github.com/repos/runelite/runelite/milestones{/number}","notifications_url":"https://api.github.com/repos/runelite/runelite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/runelite/runelite/labels{/name}","releases_url":"https://api.github.com/repos/runelite/runelite/releases{/id}","deployments_url":"https://api.github.com/repos/runelite/runelite/deployments","created_at":"2016-04-30T20:48:02Z","updated_at":"2018-05-05T01:49:01Z","pushed_at":"2018-05-05T02:33:21Z","git_url":"git://github.com/runelite/runelite.git","ssh_url":"git@github.com:runelite/runelite.git","clone_url":"https://github.com/runelite/runelite.git","svn_url":"https://github.com/runelite/runelite","homepage":"https://runelite.net","size":38957,"stargazers_count":475,"watchers_count":475,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":422,"mirror_url":null,"archived":false,"open_issues_count":677,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":422,"open_issues":677,"watchers":475,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/runelite/runelite/pulls/574"},"html":{"href":"https://github.com/runelite/runelite/pull/574"},"issue":{"href":"https://api.github.com/repos/runelite/runelite/issues/574"},"comments":{"href":"https://api.github.com/repos/runelite/runelite/issues/574/comments"},"review_comments":{"href":"https://api.github.com/repos/runelite/runelite/pulls/574/comments"},"review_comment":{"href":"https://api.github.com/repos/runelite/runelite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/runelite/runelite/pulls/574/commits"},"statuses":{"href":"https://api.github.com/repos/runelite/runelite/statuses/f4ba42e46ddeda37e19e1132579a5d109fca1ef1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"LeviSchuck"}}