{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/413","labels_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/413/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/413/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/413/events","html_url":"https://github.com/SpongePowered/SpongeCommon/pull/413","id":125840506,"number":413,"title":"Prevent creation of a size 0 itemstack when deserializing","user":{"login":"Aaron1011","id":1408859,"avatar_url":"https://avatars.githubusercontent.com/u/1408859?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaron1011","html_url":"https://github.com/Aaron1011","followers_url":"https://api.github.com/users/Aaron1011/followers","following_url":"https://api.github.com/users/Aaron1011/following{/other_user}","gists_url":"https://api.github.com/users/Aaron1011/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaron1011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaron1011/subscriptions","organizations_url":"https://api.github.com/users/Aaron1011/orgs","repos_url":"https://api.github.com/users/Aaron1011/repos","events_url":"https://api.github.com/users/Aaron1011/events{/privacy}","received_events_url":"https://api.github.com/users/Aaron1011/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-10T19:41:35Z","updated_at":"2016-01-11T03:28:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/413","html_url":"https://github.com/SpongePowered/SpongeCommon/pull/413","diff_url":"https://github.com/SpongePowered/SpongeCommon/pull/413.diff","patch_url":"https://github.com/SpongePowered/SpongeCommon/pull/413.patch"},"body":"This resolves https://github.com/SpongePowered/SpongeForge/issues/483.\r\n\r\nWhen an `ItemStack` is being deserialized from NBT, it will have a size of 0 if the `Count` tag isn't present. This usually happens when using `/summon`, as in the linked issue.\r\n\r\nVanilla usually doesn't care about this, however, our damage event code expects that an `ItemStack` has a size of 0 when it breaks. This means that the first time an entity wearing a size-0 `ItemStack` takes damage, our code removes the `ItemStack` from its inventory.\r\n\r\nI've added a config option, in case this causes unexpected behavior with mods and/or Forge."},"comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/comments/170424058","html_url":"https://github.com/SpongePowered/SpongeCommon/pull/413#issuecomment-170424058","issue_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/413","id":170424058,"user":{"login":"kashike","id":5474071,"avatar_url":"https://avatars.githubusercontent.com/u/5474071?v=3","gravatar_id":"","url":"https://api.github.com/users/kashike","html_url":"https://github.com/kashike","followers_url":"https://api.github.com/users/kashike/followers","following_url":"https://api.github.com/users/kashike/following{/other_user}","gists_url":"https://api.github.com/users/kashike/gists{/gist_id}","starred_url":"https://api.github.com/users/kashike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kashike/subscriptions","organizations_url":"https://api.github.com/users/kashike/orgs","repos_url":"https://api.github.com/users/kashike/repos","events_url":"https://api.github.com/users/kashike/events{/privacy}","received_events_url":"https://api.github.com/users/kashike/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T03:28:50Z","updated_at":"2016-01-11T03:28:50Z","body":"This would break things that require the size to be `0`. It would be better, perhaps, to do as @simon816 said."}}