{"action":"created","comment":{"url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/comments/73573706","id":73573706,"diff_hunk":"@@ -0,0 +1,118 @@\n+/**\n+ * @author Aleksey Terzi\n+ *\n+ */\n+\n+package com.github.maxopoly.WurstCivTools.effect;\n+\n+import org.bukkit.Bukkit;\n+import org.bukkit.Location;\n+import org.bukkit.Material;\n+import org.bukkit.World;\n+import org.bukkit.block.Block;\n+import org.bukkit.entity.Player;\n+import org.bukkit.event.block.BlockBreakEvent;\n+import org.bukkit.inventory.ItemStack;\n+\n+import vg.civcraft.mc.citadel.Citadel;\n+import vg.civcraft.mc.citadel.PlayerState;\n+import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement;\n+import vg.civcraft.mc.citadel.reinforcement.Reinforcement;\n+\n+import com.github.maxopoly.WurstCivTools.WurstCivTools;\n+\n+public class LeafShears extends WurstEffect {\n+\tprivate int clearCubeSize;\n+\n+\tpublic LeafShears(int clearCubeSize) {\n+\t\tsuper();\n+\t\t\n+\t\tthis.clearCubeSize = clearCubeSize;\n+\t}\n+\n+\t@Override\n+\tpublic void handleBreak(Player p, BlockBreakEvent e) {\n+\t\tif(e.isCancelled()) {\n+\t\t\treturn;\n+\t\t}\n+\t\t\n+\t\tfinal Player player = p;\n+\t\t\n+\t\tif(player == null) {\n+\t\t\treturn;\n+\t\t}\n+\t\t\n+\t\tif(!isLeaf(e.getBlock())) {\n+\t\t\treturn;\n+\t\t}\n+\t\t\n+\t\te.setCancelled(true);\n+\t\te.getBlock().setType(Material.AIR);\n+\t\t\n+\t\t//Following manipulations are needed to synchronize tool durability with client after cancel block break\n+\t\tfinal ItemStack handItem = player.getInventory().getItemInMainHand();\n+\n+\t\thandItem.setDurability((short)(handItem.getDurability() + 1));\n+\t\t\n+\t\tfinal Location center = e.getBlock().getLocation();\n+\t\t\n+\t\tBukkit.getScheduler().runTask(WurstCivTools.getPlugin(), new Runnable() {\n+            public void run() {\n+            \thandItem.setDurability((short)(handItem.getDurability() - 1));","path":"src/main/java/com/github/maxopoly/WurstCivTools/effect/LeafShears.java","position":61,"original_position":61,"commit_id":"cf718434eda27eafb167d58b42327b778bfeff92","original_commit_id":"cf718434eda27eafb167d58b42327b778bfeff92","user":{"login":"ProgrammerDan","id":409230,"avatar_url":"https://avatars.githubusercontent.com/u/409230?v=3","gravatar_id":"","url":"https://api.github.com/users/ProgrammerDan","html_url":"https://github.com/ProgrammerDan","followers_url":"https://api.github.com/users/ProgrammerDan/followers","following_url":"https://api.github.com/users/ProgrammerDan/following{/other_user}","gists_url":"https://api.github.com/users/ProgrammerDan/gists{/gist_id}","starred_url":"https://api.github.com/users/ProgrammerDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProgrammerDan/subscriptions","organizations_url":"https://api.github.com/users/ProgrammerDan/orgs","repos_url":"https://api.github.com/users/ProgrammerDan/repos","events_url":"https://api.github.com/users/ProgrammerDan/events{/privacy}","received_events_url":"https://api.github.com/users/ProgrammerDan/received_events","type":"User","site_admin":false},"body":"Ah, shame. I suppose 2, although it's just another soft-point for maintenance on version upgrades. It'll do!","created_at":"2016-08-04T18:10:10Z","updated_at":"2016-08-04T18:10:10Z","html_url":"https://github.com/Civcraft/WurstCivTools/pull/7#discussion_r73573706","pull_request_url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/comments/73573706"},"html":{"href":"https://github.com/Civcraft/WurstCivTools/pull/7#discussion_r73573706"},"pull_request":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7","id":80068848,"html_url":"https://github.com/Civcraft/WurstCivTools/pull/7","diff_url":"https://github.com/Civcraft/WurstCivTools/pull/7.diff","patch_url":"https://github.com/Civcraft/WurstCivTools/pull/7.patch","issue_url":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/7","number":7,"state":"open","locked":false,"title":"Added LeafShears tool and small fix","user":{"login":"Aleksey-Terzi","id":5383652,"avatar_url":"https://avatars.githubusercontent.com/u/5383652?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksey-Terzi","html_url":"https://github.com/Aleksey-Terzi","followers_url":"https://api.github.com/users/Aleksey-Terzi/followers","following_url":"https://api.github.com/users/Aleksey-Terzi/following{/other_user}","gists_url":"https://api.github.com/users/Aleksey-Terzi/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksey-Terzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksey-Terzi/subscriptions","organizations_url":"https://api.github.com/users/Aleksey-Terzi/orgs","repos_url":"https://api.github.com/users/Aleksey-Terzi/repos","events_url":"https://api.github.com/users/Aleksey-Terzi/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksey-Terzi/received_events","type":"User","site_admin":false},"body":"1) Added LeafShears which allows to clear leaves fast and without loosing durability on this special shears when breaking leaves. Default 'clear cube' has size 3 x 3 x 3. Could be configured.\r\nNew tool is requiring Citadel plugin.\r\n\r\n2) Fixed error in LoreTag.appliedOn method when item's lore = null","created_at":"2016-08-04T12:23:45Z","updated_at":"2016-08-04T18:10:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14c4189238204d2e46d0a236806a61b6a88da488","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/7/comments","statuses_url":"https://api.github.com/repos/Civcraft/WurstCivTools/statuses/cf718434eda27eafb167d58b42327b778bfeff92","head":{"label":"Aleksey-Terzi:master","ref":"master","sha":"cf718434eda27eafb167d58b42327b778bfeff92","user":{"login":"Aleksey-Terzi","id":5383652,"avatar_url":"https://avatars.githubusercontent.com/u/5383652?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksey-Terzi","html_url":"https://github.com/Aleksey-Terzi","followers_url":"https://api.github.com/users/Aleksey-Terzi/followers","following_url":"https://api.github.com/users/Aleksey-Terzi/following{/other_user}","gists_url":"https://api.github.com/users/Aleksey-Terzi/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksey-Terzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksey-Terzi/subscriptions","organizations_url":"https://api.github.com/users/Aleksey-Terzi/orgs","repos_url":"https://api.github.com/users/Aleksey-Terzi/repos","events_url":"https://api.github.com/users/Aleksey-Terzi/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksey-Terzi/received_events","type":"User","site_admin":false},"repo":{"id":64918586,"name":"WurstCivTools","full_name":"Aleksey-Terzi/WurstCivTools","owner":{"login":"Aleksey-Terzi","id":5383652,"avatar_url":"https://avatars.githubusercontent.com/u/5383652?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksey-Terzi","html_url":"https://github.com/Aleksey-Terzi","followers_url":"https://api.github.com/users/Aleksey-Terzi/followers","following_url":"https://api.github.com/users/Aleksey-Terzi/following{/other_user}","gists_url":"https://api.github.com/users/Aleksey-Terzi/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksey-Terzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksey-Terzi/subscriptions","organizations_url":"https://api.github.com/users/Aleksey-Terzi/orgs","repos_url":"https://api.github.com/users/Aleksey-Terzi/repos","events_url":"https://api.github.com/users/Aleksey-Terzi/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksey-Terzi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aleksey-Terzi/WurstCivTools","description":null,"fork":true,"url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools","forks_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/forks","keys_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/teams","hooks_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/hooks","issue_events_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/issues/events{/number}","events_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/events","assignees_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/assignees{/user}","branches_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/branches{/branch}","tags_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/tags","blobs_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/statuses/{sha}","languages_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/languages","stargazers_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/stargazers","contributors_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/contributors","subscribers_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/subscribers","subscription_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/subscription","commits_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/contents/{+path}","compare_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/merges","archive_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/downloads","issues_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/issues{/number}","pulls_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/pulls{/number}","milestones_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/milestones{/number}","notifications_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/labels{/name}","releases_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/releases{/id}","deployments_url":"https://api.github.com/repos/Aleksey-Terzi/WurstCivTools/deployments","created_at":"2016-08-04T08:46:11Z","updated_at":"2016-08-04T08:46:12Z","pushed_at":"2016-08-04T12:20:14Z","git_url":"git://github.com/Aleksey-Terzi/WurstCivTools.git","ssh_url":"git@github.com:Aleksey-Terzi/WurstCivTools.git","clone_url":"https://github.com/Aleksey-Terzi/WurstCivTools.git","svn_url":"https://github.com/Aleksey-Terzi/WurstCivTools","homepage":null,"size":29,"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":"Civcraft:master","ref":"master","sha":"d8f3d7b01017f1719ae365e06f788a4718e15ec2","user":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"repo":{"id":54427359,"name":"WurstCivTools","full_name":"Civcraft/WurstCivTools","owner":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Civcraft/WurstCivTools","description":"","fork":false,"url":"https://api.github.com/repos/Civcraft/WurstCivTools","forks_url":"https://api.github.com/repos/Civcraft/WurstCivTools/forks","keys_url":"https://api.github.com/repos/Civcraft/WurstCivTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Civcraft/WurstCivTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Civcraft/WurstCivTools/teams","hooks_url":"https://api.github.com/repos/Civcraft/WurstCivTools/hooks","issue_events_url":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/events{/number}","events_url":"https://api.github.com/repos/Civcraft/WurstCivTools/events","assignees_url":"https://api.github.com/repos/Civcraft/WurstCivTools/assignees{/user}","branches_url":"https://api.github.com/repos/Civcraft/WurstCivTools/branches{/branch}","tags_url":"https://api.github.com/repos/Civcraft/WurstCivTools/tags","blobs_url":"https://api.github.com/repos/Civcraft/WurstCivTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Civcraft/WurstCivTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Civcraft/WurstCivTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Civcraft/WurstCivTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Civcraft/WurstCivTools/statuses/{sha}","languages_url":"https://api.github.com/repos/Civcraft/WurstCivTools/languages","stargazers_url":"https://api.github.com/repos/Civcraft/WurstCivTools/stargazers","contributors_url":"https://api.github.com/repos/Civcraft/WurstCivTools/contributors","subscribers_url":"https://api.github.com/repos/Civcraft/WurstCivTools/subscribers","subscription_url":"https://api.github.com/repos/Civcraft/WurstCivTools/subscription","commits_url":"https://api.github.com/repos/Civcraft/WurstCivTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Civcraft/WurstCivTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Civcraft/WurstCivTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Civcraft/WurstCivTools/contents/{+path}","compare_url":"https://api.github.com/repos/Civcraft/WurstCivTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Civcraft/WurstCivTools/merges","archive_url":"https://api.github.com/repos/Civcraft/WurstCivTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Civcraft/WurstCivTools/downloads","issues_url":"https://api.github.com/repos/Civcraft/WurstCivTools/issues{/number}","pulls_url":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls{/number}","milestones_url":"https://api.github.com/repos/Civcraft/WurstCivTools/milestones{/number}","notifications_url":"https://api.github.com/repos/Civcraft/WurstCivTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Civcraft/WurstCivTools/labels{/name}","releases_url":"https://api.github.com/repos/Civcraft/WurstCivTools/releases{/id}","deployments_url":"https://api.github.com/repos/Civcraft/WurstCivTools/deployments","created_at":"2016-03-21T22:26:57Z","updated_at":"2016-03-21T22:42:24Z","pushed_at":"2016-08-04T12:23:45Z","git_url":"git://github.com/Civcraft/WurstCivTools.git","ssh_url":"git@github.com:Civcraft/WurstCivTools.git","clone_url":"https://github.com/Civcraft/WurstCivTools.git","svn_url":"https://github.com/Civcraft/WurstCivTools","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7"},"html":{"href":"https://github.com/Civcraft/WurstCivTools/pull/7"},"issue":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/7"},"comments":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Civcraft/WurstCivTools/statuses/cf718434eda27eafb167d58b42327b778bfeff92"}}}}
{"actor":{"display_login":"ProgrammerDan"}}