{"action":"created","issue":{"url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/1","repository_url":"https://api.github.com/repos/KittehOrg/Spectastic","labels_url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/1/comments","events_url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/1/events","html_url":"https://github.com/KittehOrg/Spectastic/issues/1","id":140224781,"number":1,"title":"Safe Spawning","user":{"login":"20zinnm","id":6132034,"avatar_url":"https://avatars.githubusercontent.com/u/6132034?v=3","gravatar_id":"","url":"https://api.github.com/users/20zinnm","html_url":"https://github.com/20zinnm","followers_url":"https://api.github.com/users/20zinnm/followers","following_url":"https://api.github.com/users/20zinnm/following{/other_user}","gists_url":"https://api.github.com/users/20zinnm/gists{/gist_id}","starred_url":"https://api.github.com/users/20zinnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/20zinnm/subscriptions","organizations_url":"https://api.github.com/users/20zinnm/orgs","repos_url":"https://api.github.com/users/20zinnm/repos","events_url":"https://api.github.com/users/20zinnm/events{/privacy}","received_events_url":"https://api.github.com/users/20zinnm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-11T16:14:04Z","updated_at":"2016-03-15T16:23:42Z","closed_at":null,"body":"So we all know people are going to be a******* and place blocks where someone spectates. Therefore, I propose the following algorithm for determining a \"safe spawn\":\r\n\r\nsafe(pos) =\r\n (a) no lava or harmful liquid above or below the position without a separating block.\r\n (b) no blocks that could suffocate or trap the player (spider webs?)\r\n (c) a player could AFK there safely (without drowning).\r\n\r\n1. Get the block where the player came from. If it's safe, go there. Otherwise, continue.\r\n2. Calculate the next element of the golden spiral, based on the original position. Check all blocks in that element for safety. If at any point a block is safe, escape the algorithm.\r\n3. If there is no safe block in the spiral, go back to 2.\r\n4. If after a configurable amount of steps no safe location was found, teleport to the top of wherever their original location was (if it's safe as well) or to spawn or another configurable strategy.\r\n\r\nThis has the benefit of returning them as close to their original location as possible while progressively broadening the search."},"comment":{"url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/comments/196905974","html_url":"https://github.com/KittehOrg/Spectastic/issues/1#issuecomment-196905974","issue_url":"https://api.github.com/repos/KittehOrg/Spectastic/issues/1","id":196905974,"user":{"login":"mbax","id":181668,"avatar_url":"https://avatars.githubusercontent.com/u/181668?v=3","gravatar_id":"","url":"https://api.github.com/users/mbax","html_url":"https://github.com/mbax","followers_url":"https://api.github.com/users/mbax/followers","following_url":"https://api.github.com/users/mbax/following{/other_user}","gists_url":"https://api.github.com/users/mbax/gists{/gist_id}","starred_url":"https://api.github.com/users/mbax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbax/subscriptions","organizations_url":"https://api.github.com/users/mbax/orgs","repos_url":"https://api.github.com/users/mbax/repos","events_url":"https://api.github.com/users/mbax/events{/privacy}","received_events_url":"https://api.github.com/users/mbax/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T16:23:42Z","updated_at":"2016-03-15T16:23:42Z","body":"Now having more free time to talk about this.\r\n\r\nSo, store player's location along with the game mode when spectating.\r\n\r\nAs for defining safe: What if lava is making its way down? :3"}}