{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/517","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/517/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/517/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/517/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/517","id":64367247,"number":517,"title":"GameProfile custom component system","user":{"login":"KieronWiltshire","id":4332346,"avatar_url":"https://avatars.githubusercontent.com/u/4332346?v=3","gravatar_id":"","url":"https://api.github.com/users/KieronWiltshire","html_url":"https://github.com/KieronWiltshire","followers_url":"https://api.github.com/users/KieronWiltshire/followers","following_url":"https://api.github.com/users/KieronWiltshire/following{/other_user}","gists_url":"https://api.github.com/users/KieronWiltshire/gists{/gist_id}","starred_url":"https://api.github.com/users/KieronWiltshire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KieronWiltshire/subscriptions","organizations_url":"https://api.github.com/users/KieronWiltshire/orgs","repos_url":"https://api.github.com/users/KieronWiltshire/repos","events_url":"https://api.github.com/users/KieronWiltshire/events{/privacy}","received_events_url":"https://api.github.com/users/KieronWiltshire/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/input%20wanted","name":"input wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-25T20:39:23Z","updated_at":"2015-03-25T22:29:28Z","closed_at":null,"body":"In Bukkit the Player object was really quite strict on what you could do, and you couldn't really customize it in any way, shape or form. There wasn't really any built-in methods to allow you to attach information to a user, so I decided to come up with a solution for Sponge.\r\n\r\nThe idea I came up with is the possibility to create custom components that you can attach to the GameProfile object so you can later retrieve the component when it is needed. The solution would be to attach it to the GameProfile object, an object which is specific to the Player.\r\n\r\nI believe the idea of allowing custom components allows for a lot of flexibility in practise as well as clean and easy to work with code.\r\n\r\nHere is how I could imagine the GameProfile handling the component system:\r\nhttps://gist.github.com/KieronWiltshire/a0fc8094fa3b5919601f\r\n\r\nHere is an example component that I created to maybe give you guys an idea of what a component could be used for:\r\nhttps://gist.github.com/KieronWiltshire/f1700bdb7776c68460ec\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments/86237259","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/517#issuecomment-86237259","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/517","id":86237259,"user":{"login":"hypereddie","id":879484,"avatar_url":"https://avatars.githubusercontent.com/u/879484?v=3","gravatar_id":"","url":"https://api.github.com/users/hypereddie","html_url":"https://github.com/hypereddie","followers_url":"https://api.github.com/users/hypereddie/followers","following_url":"https://api.github.com/users/hypereddie/following{/other_user}","gists_url":"https://api.github.com/users/hypereddie/gists{/gist_id}","starred_url":"https://api.github.com/users/hypereddie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypereddie/subscriptions","organizations_url":"https://api.github.com/users/hypereddie/orgs","repos_url":"https://api.github.com/users/hypereddie/repos","events_url":"https://api.github.com/users/hypereddie/events{/privacy}","received_events_url":"https://api.github.com/users/hypereddie/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T22:29:28Z","updated_at":"2015-03-25T22:29:28Z","body":"Yes but I feel like having a whole system dedicated to accomplish the same\ntask for just a name difference seems like a waste. I can see this as a\nconvenience method of the current getData system, but not a whole new\nsystem...\n\nOn 6:21PM, Wed, Mar 25, 2015 Kieron Wiltshire <notifications@github.com>\nwrote:\n\n> @hypereddie <https://github.com/hypereddie> I'm guessing it would work in\n> a similar fashion to getData but the point was to make it obvious that it's\n> a component, for example you could have a component which creates cool\n> effects, but each player has different effects so you could attach a\n> different EffectComponent to each player and just do something like what\n> I've demonstrated below:\n>\n> // on move event or whatever\n> player.getProfile().getComponent(EffectComponent.class).effect();\n>\n> Now in my opinion, the name 'component' makes more sense here instead of\n> data.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/SpongePowered/SpongeAPI/issues/517#issuecomment-86235595>\n> .\n>\n"}}