{"action":"opened","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/866","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/866/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/866/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/866/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/866","id":110747401,"number":866,"title":"new interface Located, implemented by both LocatedSource and Entity","user":{"login":"vorburger","id":298598,"avatar_url":"https://avatars.githubusercontent.com/u/298598?v=3","gravatar_id":"","url":"https://api.github.com/users/vorburger","html_url":"https://github.com/vorburger","followers_url":"https://api.github.com/users/vorburger/followers","following_url":"https://api.github.com/users/vorburger/following{/other_user}","gists_url":"https://api.github.com/users/vorburger/gists{/gist_id}","starred_url":"https://api.github.com/users/vorburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorburger/subscriptions","organizations_url":"https://api.github.com/users/vorburger/orgs","repos_url":"https://api.github.com/users/vorburger/repos","events_url":"https://api.github.com/users/vorburger/events{/privacy}","received_events_url":"https://api.github.com/users/vorburger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-09T22:37:53Z","updated_at":"2015-10-09T22:37:53Z","closed_at":null,"body":"I found myself writing some helper code which I wanted to work for both a LocatedSource and an Entity (see https://github.com/vorburger/SwissKnightMinecraft/commit/b7ba52ca2e699058707e1d9f98ef1f40ea126838#diff-8284ad004f85958defdff90728651876L42 for background). \r\n\r\nBoth LocatedSource and Entity have a Location and a World, but share no common interface. So I sent a wish for built-in Duck Typing in Java (https://en.wikipedia.org/wiki/Duck_typing#In_Java), alas the magic fairy didn't grant my wish, so instead I'm filing this proposal - thus how about:\r\n\r\n    interface Located {\r\n        Location getLocation();\r\n        World getWorld();\r\n    }\r\n\r\n    interface LocatedSource extends Located, CommandSource\r\n\r\n    interface Entity extends Located, ...\r\n\r\nClose if this is stupid for some reason, or +1 if this would be useful (I'll send a PR).\r\n\r\nIf there already is an interface for something that is a Location in a World, perhaps that could be used."}}