{"action":"created","issue":{"url":"https://api.github.com/repos/cuberite/cuberite/issues/2390","labels_url":"https://api.github.com/repos/cuberite/cuberite/issues/2390/labels{/name}","comments_url":"https://api.github.com/repos/cuberite/cuberite/issues/2390/comments","events_url":"https://api.github.com/repos/cuberite/cuberite/issues/2390/events","html_url":"https://github.com/cuberite/cuberite/issues/2390","id":97149872,"number":2390,"title":"Possible solution to lua extending cBlockHandler and cBlockEntity.","user":{"login":"SamJBarney","id":1827860,"avatar_url":"https://avatars.githubusercontent.com/u/1827860?v=3","gravatar_id":"","url":"https://api.github.com/users/SamJBarney","html_url":"https://github.com/SamJBarney","followers_url":"https://api.github.com/users/SamJBarney/followers","following_url":"https://api.github.com/users/SamJBarney/following{/other_user}","gists_url":"https://api.github.com/users/SamJBarney/gists{/gist_id}","starred_url":"https://api.github.com/users/SamJBarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamJBarney/subscriptions","organizations_url":"https://api.github.com/users/SamJBarney/orgs","repos_url":"https://api.github.com/users/SamJBarney/repos","events_url":"https://api.github.com/users/SamJBarney/events{/privacy}","received_events_url":"https://api.github.com/users/SamJBarney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-24T21:22:02Z","updated_at":"2015-07-26T10:51:38Z","closed_at":null,"body":"As I am for making cuberite as forge compatible as possible I think it is getting close to the time where we need to make it possible for plugins to extend default functionality of blocks and block entities, and other such classes.\r\n\r\nI know that there would be blocking issues if the code to handle them was left in the plugins, so I propose that each cWorld have a separate cLuaState to store the code for handling cLuaBlock and cLuaBlockEntity, etc.\r\n\r\nSo how do we pass functions between cLuaStates? By converting the function to a string using string.dump().\r\n\r\nJust an idea I've had. Still pretty raw and needs a bit of flushing out."},"comment":{"url":"https://api.github.com/repos/cuberite/cuberite/issues/comments/124969902","html_url":"https://github.com/cuberite/cuberite/issues/2390#issuecomment-124969902","issue_url":"https://api.github.com/repos/cuberite/cuberite/issues/2390","id":124969902,"user":{"login":"worktycho","id":2102806,"avatar_url":"https://avatars.githubusercontent.com/u/2102806?v=3","gravatar_id":"","url":"https://api.github.com/users/worktycho","html_url":"https://github.com/worktycho","followers_url":"https://api.github.com/users/worktycho/followers","following_url":"https://api.github.com/users/worktycho/following{/other_user}","gists_url":"https://api.github.com/users/worktycho/gists{/gist_id}","starred_url":"https://api.github.com/users/worktycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/worktycho/subscriptions","organizations_url":"https://api.github.com/users/worktycho/orgs","repos_url":"https://api.github.com/users/worktycho/repos","events_url":"https://api.github.com/users/worktycho/events{/privacy}","received_events_url":"https://api.github.com/users/worktycho/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T10:51:38Z","updated_at":"2015-07-26T10:51:38Z","body":"Part of the point of the design would be to make it difficult to pass in state. A message passing api would be a better way of handaling state. State complicates a lot of things, so avoiding clousures helps. And if we put the code in the main lua state, we will get a lot contention on the plugin lock."}}