{"action":"created","issue":{"url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/236","repository_url":"https://api.github.com/repos/dmulloy2/ProtocolLib","labels_url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/236/comments","events_url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/236/events","html_url":"https://github.com/dmulloy2/ProtocolLib/issues/236","id":164617305,"number":236,"title":"MinecraftReflection.isChunkPosition causes lag","user":{"login":"ItsHarry","id":914835,"avatar_url":"https://avatars.githubusercontent.com/u/914835?v=3","gravatar_id":"","url":"https://api.github.com/users/ItsHarry","html_url":"https://github.com/ItsHarry","followers_url":"https://api.github.com/users/ItsHarry/followers","following_url":"https://api.github.com/users/ItsHarry/following{/other_user}","gists_url":"https://api.github.com/users/ItsHarry/gists{/gist_id}","starred_url":"https://api.github.com/users/ItsHarry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ItsHarry/subscriptions","organizations_url":"https://api.github.com/users/ItsHarry/orgs","repos_url":"https://api.github.com/users/ItsHarry/repos","events_url":"https://api.github.com/users/ItsHarry/events{/privacy}","received_events_url":"https://api.github.com/users/ItsHarry/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-08T21:10:52Z","updated_at":"2016-07-09T20:03:55Z","closed_at":"2016-07-09T19:32:41Z","body":"I'm using Spigot 1.8, and there doesn't seem to be any class by the name of ChunkPosition in the NMS package. I checked 1.9 and there is also no class by that name.\r\n\r\nMinecraftReflection.getChunkPositionClass() tries to load the class using MinecraftReflection.getMinecraftClass(), but because it doesn't exist, it is never added to CachedPackage.cache, causing the class to be loaded every time the method is called, which is expensive and causes lag.\r\n\r\nThis should be prevented because setMinecraftClass is called in the catch (RuntimeException) block in MinecraftReflection.getChunkPositionClass(). However, it seems that FuzzyReflection.fromClass(normalChunkGenerator).getMethod(selected) throws IllegalArgumentExcception causing it to be never be cached.\r\n\r\nWhy the FuzzyReflection.fromClass(normalChunkGenerator).getMethod(selected) throws IllegalArgumentException I don't know\r\n\r\nI'm not sure if this issue is 1.8-specific, I'm assuming it also happens in ProtocolLib 4 because the  code mentioned is unchanged\r\n\r\nIt can cause quite a bit of lag if it is called often. (For example HolographicDisplays loading for many players)"},"comment":{"url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/comments/231553128","html_url":"https://github.com/dmulloy2/ProtocolLib/issues/236#issuecomment-231553128","issue_url":"https://api.github.com/repos/dmulloy2/ProtocolLib/issues/236","id":231553128,"user":{"login":"ItsHarry","id":914835,"avatar_url":"https://avatars.githubusercontent.com/u/914835?v=3","gravatar_id":"","url":"https://api.github.com/users/ItsHarry","html_url":"https://github.com/ItsHarry","followers_url":"https://api.github.com/users/ItsHarry/followers","following_url":"https://api.github.com/users/ItsHarry/following{/other_user}","gists_url":"https://api.github.com/users/ItsHarry/gists{/gist_id}","starred_url":"https://api.github.com/users/ItsHarry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ItsHarry/subscriptions","organizations_url":"https://api.github.com/users/ItsHarry/orgs","repos_url":"https://api.github.com/users/ItsHarry/repos","events_url":"https://api.github.com/users/ItsHarry/events{/privacy}","received_events_url":"https://api.github.com/users/ItsHarry/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T20:03:55Z","updated_at":"2016-07-09T20:03:55Z","body":"Thanks"}}
{"actor":{"display_login":"ItsHarry"}}