02-01-2013, 07:45 PM
An idea: how about changing the OnChunkGenerated hook to trigger *before* the chunk is added to the world, and having the same parameter set, as OnChunkGenerating - ChunkX, ChunkZ and ChunkDesc. It could then use ChunkDesc to do some last-minute changes to the generated chunk.
Why: If a plugin uses OnChunkGenerated() and modifies the chunk, the changes sometimes don't get propagated to clients that already queued that chunk for sending. This is the easy fix. Also it makes the API a bit more flexible.
Another reason: I'd like to add new hooks, OnChunkUnloading (self-explanatory name) and OnChunkAdded, that would trigger each time the chunk is loaded or generated (in cWorld:SetChunkData() ). And it would be quite ugly if the hook fired in this sequence: OnChunkGenerating - OnChunkAdded - OnChunkGenerated. It'd be much more logical to have OnChunkGenerating - OnChunkGenerated - OnChunkAdded. But that is possible only if we change the logic of the OnChunkGenerated that the chunk is not yet added to the world.
How many headaches have I just caused?
Why: If a plugin uses OnChunkGenerated() and modifies the chunk, the changes sometimes don't get propagated to clients that already queued that chunk for sending. This is the easy fix. Also it makes the API a bit more flexible.
Another reason: I'd like to add new hooks, OnChunkUnloading (self-explanatory name) and OnChunkAdded, that would trigger each time the chunk is loaded or generated (in cWorld:SetChunkData() ). And it would be quite ugly if the hook fired in this sequence: OnChunkGenerating - OnChunkAdded - OnChunkGenerated. It'd be much more logical to have OnChunkGenerating - OnChunkGenerated - OnChunkAdded. But that is possible only if we change the logic of the OnChunkGenerated that the chunk is not yet added to the world.
How many headaches have I just caused?