{"action":"opened","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/408","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/408/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/408/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/408","id":55323187,"number":408,"title":"Use Collection<X> instead of List<X> for GameRegistry.getX()","user":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-23T19:40:10Z","updated_at":"2015-01-23T19:40:10Z","closed_at":null,"body":"While thinking how to convert my plugins i encountered some inconsistencies from what java states and the API actually does.\r\n\r\nLets use `List<BlockType> getBlocks()` as example.\r\n\r\nJava states that `List`s should have a defined order. This may be true of one call of that method, but not for the calls following the first call. Because the `List` is backed by a Hash based container (Map,Set). So every time i change the underlying containers (by adding a new `BlockType` or restarting the server the order is gone. \r\nSo relying on an index or executing a binary search is a pretty bad idea for plugin authors. So I recommend changing it to a `Collection`. This will also reduce potential issues a none `RandomAccess` `List` may cause.\r\n\r\n\r\nWe furthermore will never have duplicate elements, so some implementations will probably want to use some kind of `Set` for that. Some sets can also keep their element ordering fixed. See `LinkedHashSet` or `SortedSet`. But thats up to the server impl. We should first downgrade to `Collection`s and then descide whether `Set`s are the right things for our implementation. \r\n\r\nThis are standalone changes, which will not affect the current Sponge server impl, unless they want to use the possibilities connected to it.\r\n\r\nIf this gets accepted i'll offer my help getting this implemented.\r\n\r\n"}}