{"action":"created","issue":{"url":"https://api.github.com/repos/Bukkit/Bukkit/issues/1083","labels_url":"https://api.github.com/repos/Bukkit/Bukkit/issues/1083/labels{/name}","comments_url":"https://api.github.com/repos/Bukkit/Bukkit/issues/1083/comments","events_url":"https://api.github.com/repos/Bukkit/Bukkit/issues/1083/events","html_url":"https://github.com/Bukkit/Bukkit/pull/1083","id":37197482,"number":1083,"title":"[B+C] Add Unbreakable API. Adds BUKKIT-5675","user":{"login":"Kiskae","id":546681,"avatar_url":"https://avatars.githubusercontent.com/u/546681?v=3","gravatar_id":"","url":"https://api.github.com/users/Kiskae","html_url":"https://github.com/Kiskae","followers_url":"https://api.github.com/users/Kiskae/followers","following_url":"https://api.github.com/users/Kiskae/following{/other_user}","gists_url":"https://api.github.com/users/Kiskae/gists{/gist_id}","starred_url":"https://api.github.com/users/Kiskae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kiskae/subscriptions","organizations_url":"https://api.github.com/users/Kiskae/orgs","repos_url":"https://api.github.com/users/Kiskae/repos","events_url":"https://api.github.com/users/Kiskae/events{/privacy}","received_events_url":"https://api.github.com/users/Kiskae/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"turt2live","id":1190097,"avatar_url":"https://avatars.githubusercontent.com/u/1190097?v=3","gravatar_id":"","url":"https://api.github.com/users/turt2live","html_url":"https://github.com/turt2live","followers_url":"https://api.github.com/users/turt2live/followers","following_url":"https://api.github.com/users/turt2live/following{/other_user}","gists_url":"https://api.github.com/users/turt2live/gists{/gist_id}","starred_url":"https://api.github.com/users/turt2live/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turt2live/subscriptions","organizations_url":"https://api.github.com/users/turt2live/orgs","repos_url":"https://api.github.com/users/turt2live/repos","events_url":"https://api.github.com/users/turt2live/events{/privacy}","received_events_url":"https://api.github.com/users/turt2live/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2014-07-05T11:50:52Z","updated_at":"2015-03-11T00:19:40Z","closed_at":"2015-03-09T19:25:17Z","pull_request":{"url":"https://api.github.com/repos/Bukkit/Bukkit/pulls/1083","html_url":"https://github.com/Bukkit/Bukkit/pull/1083","diff_url":"https://github.com/Bukkit/Bukkit/pull/1083.diff","patch_url":"https://github.com/Bukkit/Bukkit/pull/1083.patch"},"body":"##### The Issue:\r\nAdds API to toggle the Unbreakable item property. If this tag is enabled the item won't lose durability on use.\r\n\r\n##### Justification for this PR:\r\nUnbreakable is a native minecraft functionality, this PR just adds the ability to toggle it through Bukkit's API\r\n\r\n##### PR Breakdown:\r\n* Add members to toggle Unbreakable to the base ItemMeta API\r\n* Modify CraftItemMeta to implement API and account for Unbreakable in equals/hashcode\r\n* Add serialization of the unbreakable property, defaulting to no unbreakable. (Default behaviour in MC, since Unbreakable is only available through spawning)\r\n \r\n##### Testing Results and Materials:\r\nThe implementation was tested through a plugin using 3 commands:\r\n\r\n* **/ubreak bow** spawns a bow with unbreakable enabled, doesn't lose durability when firing\r\n* **/ubreak eqcheck** performs hashcode and equals checks on two ItemMeta's, with one being a clone with unbreaking enabled. It shows not equal for modified itemmeta, equality between clones was checked to verify it was still correct.\r\n* **/ubreak serial** serializes an itemstack with unbreaking to a string and back to an itemstack, verifying the equality between the original and the serialized version.\r\n\r\n[Test Plugin JAR](http://serverpeon.net/unbreakable-test-1.0-SNAPSHOT.jar) or [Test Plugin Sources](http://serverpeon.net/UnbreakableTest.zip)\r\n\r\n##### Relevant PR(s): \r\n \r\nB-1083 - https://github.com/Bukkit/Bukkit/pull/1083 - Add Unbreakable API  \r\nCB-1398 - https://github.com/Bukkit/CraftBukkit/pull/1398 - Implement Unbreakable API and serialization of the Unbreakable property\r\n \r\n##### JIRA Ticket: \r\nBUKKIT-5675 - https://bukkit.atlassian.net/browse/BUKKIT-5675"},"comment":{"url":"https://api.github.com/repos/Bukkit/Bukkit/issues/comments/78177143","html_url":"https://github.com/Bukkit/Bukkit/pull/1083#issuecomment-78177143","issue_url":"https://api.github.com/repos/Bukkit/Bukkit/issues/1083","id":78177143,"user":{"login":"cumandr","id":6320810,"avatar_url":"https://avatars.githubusercontent.com/u/6320810?v=3","gravatar_id":"","url":"https://api.github.com/users/cumandr","html_url":"https://github.com/cumandr","followers_url":"https://api.github.com/users/cumandr/followers","following_url":"https://api.github.com/users/cumandr/following{/other_user}","gists_url":"https://api.github.com/users/cumandr/gists{/gist_id}","starred_url":"https://api.github.com/users/cumandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cumandr/subscriptions","organizations_url":"https://api.github.com/users/cumandr/orgs","repos_url":"https://api.github.com/users/cumandr/repos","events_url":"https://api.github.com/users/cumandr/events{/privacy}","received_events_url":"https://api.github.com/users/cumandr/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T00:19:40Z","updated_at":"2015-03-11T00:19:40Z","body":"Sheesh I thought bukkit was dead and somebody still put in the effort to close a pr.."}}