Exporting cChunk - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Exporting cChunk (/thread-1928.html) |
Exporting cChunk - NiLSPACE - 05-10-2015 Is there a reason why cChunk isn't exported to the Lua API? Using that plugins could change a chunk directly instead of going through a world object first (kinda like cBlockArea, but you wouldn't have to read it from the world first). There could be a cWorld:DoWithChunk, and the cChunkStay:OnChunkAvailable callback could have a cChunk object as a 3th parameter. Thoughts? RE: Exporting cChunk - worktycho - 05-10-2015 I would support the export of DoWithChunk, and the new method DoWithChunkAt (takes block coords, rather than chunk coords). It would enable us to remove or at least depreciate a few functions that are only in cWorld for the lua API. RE: Exporting cChunk - xoft - 05-10-2015 We don't want plugins to ever get hold of a cChunk instance, who knows what kind of mayhem they would cause. Despite all the warnings there are still plugins storing entity instances between calls, and with chunks it would be much worse. You don't actually need to read cBlockArea, you can compose it and directly write it. What's the big issue about using cBlockArea anyway? It works nicely, it even has more operations than cChunk. RE: Exporting cChunk - NiLSPACE - 05-10-2015 I think we should assume that the plugins are written correctly without them storing a cChunk object. I just think some plugins could benefit if they could acces a cChunk object and change stuff from there instead of going through the cWorld first. |