{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/476","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/476/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/476/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/476","id":59399987,"number":476,"title":"Shared interface for CommandBlock/MinecartCommandBlock","user":{"login":"Minecrell","id":3035868,"avatar_url":"https://avatars.githubusercontent.com/u/3035868?v=3","gravatar_id":"","url":"https://api.github.com/users/Minecrell","html_url":"https://github.com/Minecrell","followers_url":"https://api.github.com/users/Minecrell/followers","following_url":"https://api.github.com/users/Minecrell/following{/other_user}","gists_url":"https://api.github.com/users/Minecrell/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecrell/subscriptions","organizations_url":"https://api.github.com/users/Minecrell/orgs","repos_url":"https://api.github.com/users/Minecrell/repos","events_url":"https://api.github.com/users/Minecrell/events{/privacy}","received_events_url":"https://api.github.com/users/Minecrell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/accepted","name":"accepted","color":"d4c5f9"},{"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":4,"created_at":"2015-03-01T15:28:22Z","updated_at":"2015-03-02T19:18:55Z","closed_at":null,"body":"Right now [`CommandBlock`](https://github.com/SpongePowered/SpongeAPI/blob/master/src/main/java/org/spongepowered/api/block/data/CommandBlock.java) and [`MinecartCommandBlock`](https://github.com/SpongePowered/SpongeAPI/blob/master/src/main/java/org/spongepowered/api/entity/vehicle/minecart/MinecartCommandBlock.java) are completely separate and only both implement `BlockCommandSource` but don't share the other methods available for command blocks.\r\n\r\nThis also results in inconsistent methods for `CommandBlock`/`MinecartCommandBlock` and the minecart command block is even missing most of the methods that exist for `CommandBlock`. We should put these in a separate interface (not sure about a name, `CommandBlock` exists already as the tile entity) and let both interfaces implement that.\r\n\r\nAnother way to fix, especially with SpongePowered/Sponge#187 in mind would be to move the methods to `BlockCommandSource` and have just a `BlockCommandSource getSource()` method on `CommandBlock`/`MinecartCommandBlock` as all of the properties accessed via the methods are internally actually saved in the same class as the command sender. However, as described in the mentioned issue, this might be an implementation leak then because not all implementations need to have this separate from the actual `CommandBlock` normally."},"comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments/76788422","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/476#issuecomment-76788422","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/476","id":76788422,"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},"created_at":"2015-03-02T19:18:55Z","updated_at":"2015-03-02T19:18:55Z","body":"In my opinion `EntityCommandSource` and `BlockCommandSource`/`TileCommandSource` are different things that should not be merged together. The `CommandSource` is good enogh for this already.\r\nBut there should be some shared interface for `MinecartCommandBlock` and `CommandBlock` like `CommandStorage`. Due to their abilty to store (and execute) commands. But this should be unrelated to Chests etc."}}