GitHub PullRequestReviewCommentEvent at 2014-09-14 02:04:03
Repository: Glowstone
Actor: ZephireNZ
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/comments/17516092","id":17516092,"diff_hunk":"@@ -0,0 +1,329 @@\n+package net.glowstone.entity.objects;\n+\n+import com.flowpowered.networking.Message;\n+import net.glowstone.GlowChunk;\n+import net.glowstone.entity.GlowEntity;\n+import net.glowstone.entity.GlowPlayer;\n+import net.glowstone.entity.meta.MetadataIndex;\n+import net.glowstone.net.message.play.entity.EntityMetadataMessage;\n+import net.glowstone.net.message.play.entity.EntityTeleportMessage;\n+import net.glowstone.net.message.play.entity.SpawnObjectMessage;\n+import net.glowstone.net.message.play.player.InteractEntityMessage;\n+import net.glowstone.util.Position;\n+import org.bukkit.Location;\n+import org.bukkit.Material;\n+import org.bukkit.Rotation;\n+import org.bukkit.block.BlockFace;\n+import org.bukkit.entity.EntityType;\n+import org.bukkit.entity.ItemFrame;\n+import org.bukkit.inventory.ItemStack;\n+\n+import java.util.Arrays;\n+import java.util.List;\n+\n+\n+public final class GlowItemFrame extends GlowEntity implements ItemFrame {\n+\n+    BlockFace face;\n+    Material iteminframe;\n+    int rot = 0;\n+\n+\n+    public GlowItemFrame(GlowPlayer player, Location location, BlockFace clickedface) {\n+\n+        super(location);\n+        this.face = clickedface;\n+        if (player != null) { // could be Anvil loading....\n+            ItemStack is = player.getItemInHand();\n+            int amount = is.getAmount();\n+            is.setAmount(amount - 1);\n+            if (is.getAmount() <= 0) {\n+                is = null;\n+            }\n+            player.setItemInHand(is);\n+\n+            metadata.set(MetadataIndex.ITEM_FRAME_ROTATION, 0);\n+            metadata.set(MetadataIndex.ITEM_FRAME_ITEM, new ItemStack(Material.AIR));\n+            metadata.set(MetadataIndex.AIR_TIME, 300);\n+            iteminframe = Material.AIR;\n+        }\n+    }\n+\n+    public void SetItemInFrame(ItemStack is) {\n+        if (is == null) {\n+            is = new ItemStack(Material.AIR, 1);\n+        }\n+        is.setAmount(1);\n+        iteminframe = is.getType();\n+        metadata.set(MetadataIndex.ITEM_FRAME_ITEM, is);\n+        metadata.set(MetadataIndex.ITEM_FRAME_ROTATION, 0);\n+    }\n+\n+    public void SetItemFrameRotation(int rotation) {\n+        metadata.set(MetadataIndex.ITEM_FRAME_ROTATION, (rotation));\n+    }\n+\n+    // //////////////////////////////////////////////////////////////////////////\n+    // Overrides\n+\n+    /**\n+     * Represents an item frame that is also an 0 = INTERACT, 1 = ATTACK, 2 =\n+     * INTERACT_AT (2 - Right/1- Left Click), 0 is always called with 1 or 2.\n+     */\n+    @Override\n+    public boolean entityInteract(GlowPlayer player, InteractEntityMessage message) {\n+        if (message.getAction() == 2) {\n+            if (iteminframe == Material.AIR) {\n+                ItemStack isinhand = player.getItemInHand();\n+                int amount = player.getItemInHand().getAmount();\n+                SetItemInFrame(isinhand);\n+                isinhand.setAmount(amount - 1);\n+                if (isinhand.getAmount() <= 0) {\n+                    isinhand = null;\n+                }\n+                player.setItemInHand(isinhand);\n+            } else {\n+                rot++;\n+                if (rot > 7) {\n+                    rot = 0;\n+                }\n+                SetItemFrameRotation(rot);\n+            }\n+        }\n+        if (message.getAction() == 1) {\n+            if (isEmpty()) {\n+                remove();\n+            } else {\n+                SetItemInFrame(new ItemStack(Material.AIR));","path":"src/main/java/net/glowstone/entity/objects/GlowItemFrame.java","position":97,"original_position":97,"commit_id":"e5cfe973df60c3a432d5ba0e3b0b3c1f30a9144e","original_commit_id":"e5cfe973df60c3a432d5ba0e3b0b3c1f30a9144e","user":{"login":"ZephireNZ","id":1644496,"avatar_url":"https://avatars.githubusercontent.com/u/1644496?v=2","gravatar_id":"bcdd2d6720021227c8d601f5ddf8fad9","url":"https://api.github.com/users/ZephireNZ","html_url":"https://github.com/ZephireNZ","followers_url":"https://api.github.com/users/ZephireNZ/followers","following_url":"https://api.github.com/users/ZephireNZ/following{/other_user}","gists_url":"https://api.github.com/users/ZephireNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/ZephireNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZephireNZ/subscriptions","organizations_url":"https://api.github.com/users/ZephireNZ/orgs","repos_url":"https://api.github.com/users/ZephireNZ/repos","events_url":"https://api.github.com/users/ZephireNZ/events{/privacy}","received_events_url":"https://api.github.com/users/ZephireNZ/received_events","type":"User","site_admin":false},"body":"What about dropping the item in the frame? Glowstone may not have it implemented right now, but you might as well add getWorld().dropItemNaturally()","created_at":"2014-09-14T02:04:03Z","updated_at":"2014-09-14T02:04:03Z","html_url":"https://github.com/GlowstoneMC/Glowstone/pull/280#discussion_r17516092","pull_request_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280","_links":{"self":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/comments/17516092"},"html":{"href":"https://github.com/GlowstoneMC/Glowstone/pull/280#discussion_r17516092"},"pull_request":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280"}}},"pull_request":{"url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280","id":21199055,"html_url":"https://github.com/GlowstoneMC/Glowstone/pull/280","diff_url":"https://github.com/GlowstoneMC/Glowstone/pull/280.diff","patch_url":"https://github.com/GlowstoneMC/Glowstone/pull/280.patch","issue_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/280","number":280,"state":"open","locked":false,"title":"Item Frames, Full implementation","user":{"login":"wow4201","id":1341432,"avatar_url":"https://avatars.githubusercontent.com/u/1341432?v=2","gravatar_id":"e5370d55fcaa84d73ba103933ef6f674","url":"https://api.github.com/users/wow4201","html_url":"https://github.com/wow4201","followers_url":"https://api.github.com/users/wow4201/followers","following_url":"https://api.github.com/users/wow4201/following{/other_user}","gists_url":"https://api.github.com/users/wow4201/gists{/gist_id}","starred_url":"https://api.github.com/users/wow4201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wow4201/subscriptions","organizations_url":"https://api.github.com/users/wow4201/orgs","repos_url":"https://api.github.com/users/wow4201/repos","events_url":"https://api.github.com/users/wow4201/events{/privacy}","received_events_url":"https://api.github.com/users/wow4201/received_events","type":"User","site_admin":false},"body":"Complete implementation of item frames\r\n\r\n-Placement against blocks.\r\n-1.8 (8 degrees of item rotation in frame).\r\n-Item frame and item inside item frame drop when the block it's attached to is destroyed.\r\n-Place item in frame.\r\n-Saving/Loading.\r\n-Can remove item inside of item frame, can destroy item frame.\r\n-Removes item from inventory when placing inside of item frame.\r\n\r\nThis is a fully tested and complete implementation of item frames.","created_at":"2014-09-14T00:37:55Z","updated_at":"2014-09-14T02:04:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70a87134f340ed357598683b5ab5f8f10538eada","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280/commits","review_comments_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280/comments","review_comment_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/280/comments","statuses_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/statuses/e5cfe973df60c3a432d5ba0e3b0b3c1f30a9144e","head":{"label":"wow4201:ITEM_FRAME_18","ref":"ITEM_FRAME_18","sha":"e5cfe973df60c3a432d5ba0e3b0b3c1f30a9144e","user":{"login":"wow4201","id":1341432,"avatar_url":"https://avatars.githubusercontent.com/u/1341432?v=2","gravatar_id":"e5370d55fcaa84d73ba103933ef6f674","url":"https://api.github.com/users/wow4201","html_url":"https://github.com/wow4201","followers_url":"https://api.github.com/users/wow4201/followers","following_url":"https://api.github.com/users/wow4201/following{/other_user}","gists_url":"https://api.github.com/users/wow4201/gists{/gist_id}","starred_url":"https://api.github.com/users/wow4201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wow4201/subscriptions","organizations_url":"https://api.github.com/users/wow4201/orgs","repos_url":"https://api.github.com/users/wow4201/repos","events_url":"https://api.github.com/users/wow4201/events{/privacy}","received_events_url":"https://api.github.com/users/wow4201/received_events","type":"User","site_admin":false},"repo":{"id":23756139,"name":"Glowstone","full_name":"wow4201/Glowstone","owner":{"login":"wow4201","id":1341432,"avatar_url":"https://avatars.githubusercontent.com/u/1341432?v=2","gravatar_id":"e5370d55fcaa84d73ba103933ef6f674","url":"https://api.github.com/users/wow4201","html_url":"https://github.com/wow4201","followers_url":"https://api.github.com/users/wow4201/followers","following_url":"https://api.github.com/users/wow4201/following{/other_user}","gists_url":"https://api.github.com/users/wow4201/gists{/gist_id}","starred_url":"https://api.github.com/users/wow4201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wow4201/subscriptions","organizations_url":"https://api.github.com/users/wow4201/orgs","repos_url":"https://api.github.com/users/wow4201/repos","events_url":"https://api.github.com/users/wow4201/events{/privacy}","received_events_url":"https://api.github.com/users/wow4201/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wow4201/Glowstone","description":"An open-source server for the Bukkit Minecraft modding interface.","fork":true,"url":"https://api.github.com/repos/wow4201/Glowstone","forks_url":"https://api.github.com/repos/wow4201/Glowstone/forks","keys_url":"https://api.github.com/repos/wow4201/Glowstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wow4201/Glowstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wow4201/Glowstone/teams","hooks_url":"https://api.github.com/repos/wow4201/Glowstone/hooks","issue_events_url":"https://api.github.com/repos/wow4201/Glowstone/issues/events{/number}","events_url":"https://api.github.com/repos/wow4201/Glowstone/events","assignees_url":"https://api.github.com/repos/wow4201/Glowstone/assignees{/user}","branches_url":"https://api.github.com/repos/wow4201/Glowstone/branches{/branch}","tags_url":"https://api.github.com/repos/wow4201/Glowstone/tags","blobs_url":"https://api.github.com/repos/wow4201/Glowstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wow4201/Glowstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wow4201/Glowstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/wow4201/Glowstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wow4201/Glowstone/statuses/{sha}","languages_url":"https://api.github.com/repos/wow4201/Glowstone/languages","stargazers_url":"https://api.github.com/repos/wow4201/Glowstone/stargazers","contributors_url":"https://api.github.com/repos/wow4201/Glowstone/contributors","subscribers_url":"https://api.github.com/repos/wow4201/Glowstone/subscribers","subscription_url":"https://api.github.com/repos/wow4201/Glowstone/subscription","commits_url":"https://api.github.com/repos/wow4201/Glowstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/wow4201/Glowstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/wow4201/Glowstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/wow4201/Glowstone/issues/comments/{number}","contents_url":"https://api.github.com/repos/wow4201/Glowstone/contents/{+path}","compare_url":"https://api.github.com/repos/wow4201/Glowstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wow4201/Glowstone/merges","archive_url":"https://api.github.com/repos/wow4201/Glowstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wow4201/Glowstone/downloads","issues_url":"https://api.github.com/repos/wow4201/Glowstone/issues{/number}","pulls_url":"https://api.github.com/repos/wow4201/Glowstone/pulls{/number}","milestones_url":"https://api.github.com/repos/wow4201/Glowstone/milestones{/number}","notifications_url":"https://api.github.com/repos/wow4201/Glowstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wow4201/Glowstone/labels{/name}","releases_url":"https://api.github.com/repos/wow4201/Glowstone/releases{/id}","created_at":"2014-09-07T09:01:17Z","updated_at":"2014-09-09T00:32:52Z","pushed_at":"2014-09-14T00:37:27Z","git_url":"git://github.com/wow4201/Glowstone.git","ssh_url":"git@github.com:wow4201/Glowstone.git","clone_url":"https://github.com/wow4201/Glowstone.git","svn_url":"https://github.com/wow4201/Glowstone","homepage":"http://www.glowstone.net/","size":4605,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GlowstoneMC:master","ref":"master","sha":"bbc396017a352c93b167e3a1bea5e940444e2667","user":{"login":"GlowstoneMC","id":8682517,"avatar_url":"https://avatars.githubusercontent.com/u/8682517?v=2","gravatar_id":null,"url":"https://api.github.com/users/GlowstoneMC","html_url":"https://github.com/GlowstoneMC","followers_url":"https://api.github.com/users/GlowstoneMC/followers","following_url":"https://api.github.com/users/GlowstoneMC/following{/other_user}","gists_url":"https://api.github.com/users/GlowstoneMC/gists{/gist_id}","starred_url":"https://api.github.com/users/GlowstoneMC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlowstoneMC/subscriptions","organizations_url":"https://api.github.com/users/GlowstoneMC/orgs","repos_url":"https://api.github.com/users/GlowstoneMC/repos","events_url":"https://api.github.com/users/GlowstoneMC/events{/privacy}","received_events_url":"https://api.github.com/users/GlowstoneMC/received_events","type":"Organization","site_admin":false},"repo":{"id":1501888,"name":"Glowstone","full_name":"GlowstoneMC/Glowstone","owner":{"login":"GlowstoneMC","id":8682517,"avatar_url":"https://avatars.githubusercontent.com/u/8682517?v=2","gravatar_id":null,"url":"https://api.github.com/users/GlowstoneMC","html_url":"https://github.com/GlowstoneMC","followers_url":"https://api.github.com/users/GlowstoneMC/followers","following_url":"https://api.github.com/users/GlowstoneMC/following{/other_user}","gists_url":"https://api.github.com/users/GlowstoneMC/gists{/gist_id}","starred_url":"https://api.github.com/users/GlowstoneMC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlowstoneMC/subscriptions","organizations_url":"https://api.github.com/users/GlowstoneMC/orgs","repos_url":"https://api.github.com/users/GlowstoneMC/repos","events_url":"https://api.github.com/users/GlowstoneMC/events{/privacy}","received_events_url":"https://api.github.com/users/GlowstoneMC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GlowstoneMC/Glowstone","description":"An open-source server for the Bukkit Minecraft modding interface.","fork":false,"url":"https://api.github.com/repos/GlowstoneMC/Glowstone","forks_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/forks","keys_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/teams","hooks_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/hooks","issue_events_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/events{/number}","events_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/events","assignees_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/assignees{/user}","branches_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/branches{/branch}","tags_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/tags","blobs_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/statuses/{sha}","languages_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/languages","stargazers_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/stargazers","contributors_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/contributors","subscribers_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/subscribers","subscription_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/subscription","commits_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/comments/{number}","contents_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/contents/{+path}","compare_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/merges","archive_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/downloads","issues_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues{/number}","pulls_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls{/number}","milestones_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/milestones{/number}","notifications_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/labels{/name}","releases_url":"https://api.github.com/repos/GlowstoneMC/Glowstone/releases{/id}","created_at":"2011-03-20T01:40:35Z","updated_at":"2014-09-13T15:05:47Z","pushed_at":"2014-09-12T04:19:48Z","git_url":"git://github.com/GlowstoneMC/Glowstone.git","ssh_url":"git@github.com:GlowstoneMC/Glowstone.git","clone_url":"https://github.com/GlowstoneMC/Glowstone.git","svn_url":"https://github.com/GlowstoneMC/Glowstone","homepage":"http://www.glowstone.net/","size":13394,"stargazers_count":248,"watchers_count":248,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":109,"mirror_url":null,"open_issues_count":100,"forks":109,"open_issues":100,"watchers":248,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280"},"html":{"href":"https://github.com/GlowstoneMC/Glowstone/pull/280"},"issue":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/280"},"comments":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/issues/280/comments"},"review_comments":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280/comments"},"review_comment":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/pulls/280/commits"},"statuses":{"href":"https://api.github.com/repos/GlowstoneMC/Glowstone/statuses/e5cfe973df60c3a432d5ba0e3b0b3c1f30a9144e"}}}}