{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/Mixin/issues/69","labels_url":"https://api.github.com/repos/SpongePowered/Mixin/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/Mixin/issues/69/comments","events_url":"https://api.github.com/repos/SpongePowered/Mixin/issues/69/events","html_url":"https://github.com/SpongePowered/Mixin/issues/69","id":108017091,"number":69,"title":"Shower Thoughts - Make the Goose (now the Duck) always quack like the Duck","user":{"login":"Zidane","id":744482,"avatar_url":"https://avatars.githubusercontent.com/u/744482?v=3","gravatar_id":"","url":"https://api.github.com/users/Zidane","html_url":"https://github.com/Zidane","followers_url":"https://api.github.com/users/Zidane/followers","following_url":"https://api.github.com/users/Zidane/following{/other_user}","gists_url":"https://api.github.com/users/Zidane/gists{/gist_id}","starred_url":"https://api.github.com/users/Zidane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zidane/subscriptions","organizations_url":"https://api.github.com/users/Zidane/orgs","repos_url":"https://api.github.com/users/Zidane/repos","events_url":"https://api.github.com/users/Zidane/events{/privacy}","received_events_url":"https://api.github.com/users/Zidane/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-23T22:05:50Z","updated_at":"2015-09-24T15:03:58Z","closed_at":"2015-09-24T10:35:35Z","body":"Awesome title huh?\r\n\r\nSo I had the thought yesterday while, you guessed it, in the shower to create a new type of mixin that would cover the following situation:\r\n\r\nFor Inventory, Minecraft has an IInventory interface. Lets take these two scenarios:\r\n\r\n``` class InventoryBasic implements IInventory {} ```\r\n\r\n``` class InventoryBackpack implements IInventory {} ```\r\n\r\nWhile it would be nice if mods used InventoryBasic, most just implement IInventory. Not a problem as step one in becoming a fake Duck is:\r\n\r\n```\r\n@Mixin(IInventory.class)\r\nabstract class MixinIInventory implements api.Inventory\r\n```\r\n\r\nNow I'm not silly enough to think that it'll magically implement the interface. I'm banking on it NOT doing so, I just want to add our api interface to the hierarchy. If possible (or can be made possible), I would like for my new Duck to always quack like a Duck amongst other Ducks.\r\n\r\nRiddles aside, I'd like a Mixin where I can say \"Take the following methods and mix them into anything that implements the target\". Basically my thought is I could magically make mod inventories actually have OUR methods by injecting the code into it that wouldn't change. Lets change our Mixin...\r\n\r\n```\r\n@Mixin(IInventory.class, children=true)\r\nabstract class MixinIInventoryChildren implements api.inventory {\r\n// Perform intrinsic magic here so api and minecraft interfaces don't conflict\r\n// Implement api interface methods, such as the ones for querying, by using what we have...the minecraft interface\r\n}\r\n```\r\n\r\nThat is as rough as it gets both hopefully someone out there understands what I'm going for."},"comment":{"url":"https://api.github.com/repos/SpongePowered/Mixin/issues/comments/142955861","html_url":"https://github.com/SpongePowered/Mixin/issues/69#issuecomment-142955861","issue_url":"https://api.github.com/repos/SpongePowered/Mixin/issues/69","id":142955861,"user":{"login":"Mumfrey","id":1147071,"avatar_url":"https://avatars.githubusercontent.com/u/1147071?v=3","gravatar_id":"","url":"https://api.github.com/users/Mumfrey","html_url":"https://github.com/Mumfrey","followers_url":"https://api.github.com/users/Mumfrey/followers","following_url":"https://api.github.com/users/Mumfrey/following{/other_user}","gists_url":"https://api.github.com/users/Mumfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/Mumfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mumfrey/subscriptions","organizations_url":"https://api.github.com/users/Mumfrey/orgs","repos_url":"https://api.github.com/users/Mumfrey/repos","events_url":"https://api.github.com/users/Mumfrey/events{/privacy}","received_events_url":"https://api.github.com/users/Mumfrey/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T15:03:58Z","updated_at":"2015-09-24T15:03:58Z","body":"> With this, the only thing I haven't solved is things like PlayerInventory which contain multiple inventories...but that should be easy enough by mixin into it and storing the lenses.\r\n\r\nYou are duplicating work that I've already done, Lenses are hierarchical."}}