{"action":"created","issue":{"url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/1283","labels_url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/1283/labels{/name}","comments_url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/1283/comments","events_url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/1283/events","html_url":"https://github.com/Mithion/ArsMagica2/pull/1283","id":107990210,"number":1283,"title":"Fix for crashes in issue #1212 (extended potion IDs)","user":{"login":"DoomFruit","id":9013415,"avatar_url":"https://avatars.githubusercontent.com/u/9013415?v=3","gravatar_id":"","url":"https://api.github.com/users/DoomFruit","html_url":"https://github.com/DoomFruit","followers_url":"https://api.github.com/users/DoomFruit/followers","following_url":"https://api.github.com/users/DoomFruit/following{/other_user}","gists_url":"https://api.github.com/users/DoomFruit/gists{/gist_id}","starred_url":"https://api.github.com/users/DoomFruit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoomFruit/subscriptions","organizations_url":"https://api.github.com/users/DoomFruit/orgs","repos_url":"https://api.github.com/users/DoomFruit/repos","events_url":"https://api.github.com/users/DoomFruit/events{/privacy}","received_events_url":"https://api.github.com/users/DoomFruit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T19:31:54Z","updated_at":"2015-09-25T13:36:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Mithion/ArsMagica2/pulls/1283","html_url":"https://github.com/Mithion/ArsMagica2/pull/1283","diff_url":"https://github.com/Mithion/ArsMagica2/pull/1283.diff","patch_url":"https://github.com/Mithion/ArsMagica2/pull/1283.patch"},"body":"After a fair bit of bashing on Mojang's code, I think I've managed to get around the array out of bounds exception noted in issue #1212 with potion IDs above 128. I've had to alter PotionEffect.java to change the way it saves active potion effects into your player character (was byte, now int), changed S1DPacketHandler.java to send integers instead of bytes, and had to additionally change NetHandlerClient to expect an integer instead of a byte from one of its function calls.\r\n\r\nI've tested it in a pure AM2 dev environment, where a swift swim spell with potion ID 128 worked fine (previously, it failed by complaining about a clearly unphysical array index of -128). Testing it in my full modded setup revealed that whatever it is that DragonAPI does with respect to extending the potions array (which works fine with AM2 - I'm currently running a relatively early build of 009 on my server) clashes with my code, so I put in a check and don't do anything to potions if you have DragonAPI installed - there's no sense in duplicating effort, and Reika is almost certainly a better coder than I am.\r\n\r\nI think it's solved the out of bounds potion ID issue, but could use another pair of eyes here."},"comment":{"url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/comments/143226234","html_url":"https://github.com/Mithion/ArsMagica2/pull/1283#issuecomment-143226234","issue_url":"https://api.github.com/repos/Mithion/ArsMagica2/issues/1283","id":143226234,"user":{"login":"Mithion","id":2482373,"avatar_url":"https://avatars.githubusercontent.com/u/2482373?v=3","gravatar_id":"","url":"https://api.github.com/users/Mithion","html_url":"https://github.com/Mithion","followers_url":"https://api.github.com/users/Mithion/followers","following_url":"https://api.github.com/users/Mithion/following{/other_user}","gists_url":"https://api.github.com/users/Mithion/gists{/gist_id}","starred_url":"https://api.github.com/users/Mithion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mithion/subscriptions","organizations_url":"https://api.github.com/users/Mithion/orgs","repos_url":"https://api.github.com/users/Mithion/repos","events_url":"https://api.github.com/users/Mithion/events{/privacy}","received_events_url":"https://api.github.com/users/Mithion/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T13:36:53Z","updated_at":"2015-09-25T13:36:53Z","body":"The transforms themselves look ok to me, however:\r\n\r\nThis style of ASM transforming isn't consistent with the rest of the file - using the obf_deobf_pair class will either need to be removed or the existing methods changed to use it as well."}}