{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments/58429237","id":58429237,"diff_hunk":"@@ -0,0 +1,210 @@\n+/*\n+ * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n+ *\n+ * Copyright (c) SpongePowered <https://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.api.schematic;\n+\n+import com.flowpowered.math.vector.Vector3i;\n+import com.google.common.collect.BiMap;\n+import org.spongepowered.api.block.BlockSnapshot;\n+import org.spongepowered.api.block.BlockState;\n+import org.spongepowered.api.data.DataContainer;\n+import org.spongepowered.api.data.DataSerializable;\n+import org.spongepowered.api.data.persistence.DataBuilder;\n+import org.spongepowered.api.data.persistence.InvalidDataException;\n+import org.spongepowered.api.world.World;\n+import org.spongepowered.api.world.extent.Extent;\n+\n+import java.util.Optional;\n+\n+/**\n+ * Unless otherwise noted, \"the specification\" refers to the latest version of the Schematic Specification {@url https://github\n+ * .com/SpongePowered/Schematic-Specification}.\n+ */\n+public interface Schematic extends DataSerializable {\n+\n+    /**\n+     * Gets the attached {@link DataContainer}.\n+     *\n+     * <p>Correlates with the optional `Metadata` field of the specification.</p>\n+     *\n+     * @return The attached {@link DataContainer} or {@link Optional#empty()} if none\n+     */\n+    Optional<DataContainer> getMetadata();\n+\n+    /**\n+     * Gets the width of the Schematic.\n+     *\n+     * <p>Correlates with the `Width` field of the specification.</p>\n+     *\n+     * @return The width of the Schematic.\n+     */\n+    int getWidth();\n+\n+    /**\n+     * Gets the height of the Schematic.\n+     *\n+     * <p>Correlates with the `Height` field of the specification.</p>\n+     *\n+     * @return The height of the Schematic.\n+     */\n+    int getHeight();\n+\n+    /**\n+     * Gets the length of the Schematic.\n+     *\n+     * <p>Correlates with the `Length` field of the specification.</p>\n+     *\n+     * @return The length of the Schematic.\n+     */\n+    int getLength();\n+\n+    /**\n+     * Gets the origin of the Schematic (relative to the minimum point) or the minimum point if none.\n+     *\n+     * <p>Correlates with the `OffsetX`, `OffsetY`, and `OffsetZ` fields of the specification.</p>\n+     *\n+     * @return The origin of the Schematic\n+     */\n+    Vector3i getOrigin();\n+\n+    /**\n+     * Gets the largest key in the palette.\n+     *\n+     * @return The largest key\n+     */\n+    int getPaletteMax();","path":"src/main/java/org/spongepowered/api/schematic/Schematic.java","position":96,"original_position":96,"commit_id":"3e69789b55ffb54141cfed6d82c3b58d07c707f5","original_commit_id":"3e69789b55ffb54141cfed6d82c3b58d07c707f5","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},"body":"It doesn’t. The palette could have spots, so size isn’t the biggest key. You have to take the Set of keys and sort them.\n> On Apr 4, 2016, at 1:51 PM, Aaron Hill <notifications@github.com> wrote:\n> \n> In src/main/java/org/spongepowered/api/schematic/Schematic.java <https://github.com/SpongePowered/SpongeAPI/pull/1172#discussion_r58427606>:\n> \n> > +\n> > +    /**\n> > +     * Gets the origin of the Schematic (relative to the minimum point) or the minimum point if none.\n> > +     *\n> > +     * <p>Correlates with the `OffsetX`, `OffsetY`, and `OffsetZ` fields of the specification.</p>\n> > +     *\n> > +     * @return The origin of the Schematic\n> > +     */\n> > +    Vector3i getOrigin();\n> > +\n> > +    /**\n> > +     * Gets the largest key in the palette.\n> > +     *\n> > +     * @return The largest key\n> > +     */\n> > +    int getPaletteMax();\n> I know that this is in the specification, but it's more of an implementation detail. getPalette#size already does this.\n> \n> —\n> You are receiving this because you commented.\n> Reply to this email directly or view it on GitHub <https://github.com/SpongePowered/SpongeAPI/pull/1172/files/3e69789b55ffb54141cfed6d82c3b58d07c707f5#r58427606>\n\n","created_at":"2016-04-04T19:01:04Z","updated_at":"2016-04-04T19:01:04Z","html_url":"https://github.com/SpongePowered/SpongeAPI/pull/1172#discussion_r58429237","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments/58429237"},"html":{"href":"https://github.com/SpongePowered/SpongeAPI/pull/1172#discussion_r58429237"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172","id":65178654,"html_url":"https://github.com/SpongePowered/SpongeAPI/pull/1172","diff_url":"https://github.com/SpongePowered/SpongeAPI/pull/1172.diff","patch_url":"https://github.com/SpongePowered/SpongeAPI/pull/1172.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/1172","number":1172,"state":"open","locked":false,"title":"[WIP] Schematic API","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},"body":"See #1142 and the actual specification [here](https://github.com/SpongePowered/Schematic-Specification) (https://github.com/SpongePowered/Schematic-Specification). Big thanks to @Deamon5550 for the actual specification and everyone in the SpongeDev IRC. This is my first PR, so I hope it's not _too_ bad. Input is appreciated--this is a fairly important API because the Structures system would likely be based on it. This is a non-breaking API addition (at the moment).","created_at":"2016-04-04T17:02:09Z","updated_at":"2016-04-04T19:01:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9921b1546cf2f7fc16fc545722d38490fb6b6c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/1172/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/3e69789b55ffb54141cfed6d82c3b58d07c707f5","head":{"label":"20zinnm:feature/schematicapi","ref":"feature/schematicapi","sha":"3e69789b55ffb54141cfed6d82c3b58d07c707f5","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},"repo":{"id":55426464,"name":"SpongeAPI","full_name":"20zinnm/SpongeAPI","owner":{"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},"private":false,"html_url":"https://github.com/20zinnm/SpongeAPI","description":"A Minecraft plugin API","fork":true,"url":"https://api.github.com/repos/20zinnm/SpongeAPI","forks_url":"https://api.github.com/repos/20zinnm/SpongeAPI/forks","keys_url":"https://api.github.com/repos/20zinnm/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/20zinnm/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/20zinnm/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/20zinnm/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/20zinnm/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/20zinnm/SpongeAPI/events","assignees_url":"https://api.github.com/repos/20zinnm/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/20zinnm/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/20zinnm/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/20zinnm/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/20zinnm/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/20zinnm/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/20zinnm/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/20zinnm/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/20zinnm/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/20zinnm/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/20zinnm/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/20zinnm/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/20zinnm/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/20zinnm/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/20zinnm/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/20zinnm/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/20zinnm/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/20zinnm/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/20zinnm/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/20zinnm/SpongeAPI/merges","archive_url":"https://api.github.com/repos/20zinnm/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/20zinnm/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/20zinnm/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/20zinnm/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/20zinnm/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/20zinnm/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/20zinnm/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/20zinnm/SpongeAPI/releases{/id}","deployments_url":"https://api.github.com/repos/20zinnm/SpongeAPI/deployments","created_at":"2016-04-04T16:19:59Z","updated_at":"2016-04-04T16:20:07Z","pushed_at":"2016-04-04T18:06:26Z","git_url":"git://github.com/20zinnm/SpongeAPI.git","ssh_url":"git@github.com:20zinnm/SpongeAPI.git","clone_url":"https://github.com/20zinnm/SpongeAPI.git","svn_url":"https://github.com/20zinnm/SpongeAPI","homepage":"http://www.spongepowered.org/","size":8000,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"SpongePowered:master","ref":"master","sha":"75dc084cf5f5f3eb1cebabc0e4644932dd2f80f5","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":23770421,"name":"SpongeAPI","full_name":"SpongePowered/SpongeAPI","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/SpongeAPI","description":"A Minecraft plugin API","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeAPI","forks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/releases{/id}","deployments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/deployments","created_at":"2014-09-07T20:39:25Z","updated_at":"2016-04-02T07:55:50Z","pushed_at":"2016-04-04T18:15:52Z","git_url":"git://github.com/SpongePowered/SpongeAPI.git","ssh_url":"git@github.com:SpongePowered/SpongeAPI.git","clone_url":"https://github.com/SpongePowered/SpongeAPI.git","svn_url":"https://github.com/SpongePowered/SpongeAPI","homepage":"http://www.spongepowered.org/","size":22082,"stargazers_count":848,"watchers_count":848,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":354,"mirror_url":null,"open_issues_count":121,"forks":354,"open_issues":121,"watchers":848,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172"},"html":{"href":"https://github.com/SpongePowered/SpongeAPI/pull/1172"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/1172"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/1172/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/1172/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/3e69789b55ffb54141cfed6d82c3b58d07c707f5"}}}}