06-06-2012, 02:13 AM
That would work, but what if the second plugin wanted to communicate something back to the first plugin? Then you'd need a third hook. And a fourth, later. Generally, this is a bad idea, we can come up with something better. At the very least, "OnPluginBroadcast()", which is triggerred whenever a plugin calls a "Broadcast()" method.
Generation: Misunderstanding. I thought you wanted two more hooks, in addition to the OnChunkGenerated(). Now I get it and we're in agreement here, except for the names
This is the generator pseudo-code, as we both want it:
Generation: Misunderstanding. I thought you wanted two more hooks, in addition to the OnChunkGenerated(). Now I get it and we're in agreement here, except for the names
This is the generator pseudo-code, as we both want it:
Code:
// received another chunk for generating
if (!CallHook("OnChunkGenerating", ChunkData))
{
// Hook didn't generate the chunk, we need to do it ourselves:
GenerateChunkUsingInternal(ChunkData);
}
cWorld->ChunkGenerated(ChunkData); // Send the chunk data to cWorld
CallHook("OnChunkGenerated", ChunkCoords);