Lua hooks needed!
#75
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? Smile
Reply
Thanks given by:


Messages In This Thread
Lua hooks needed! - by Taugeshtu - 06-05-2012, 11:34 PM
RE: Lua hooks needed! - by xoft - 06-06-2012, 12:00 AM
RE: Lua hooks needed! - by xoft - 06-06-2012, 01:24 AM
RE: Lua hooks needed! - by Taugeshtu - 06-06-2012, 01:29 AM
RE: Lua hooks needed! - by xoft - 06-06-2012, 01:38 AM
RE: Lua hooks needed! - by Taugeshtu - 06-06-2012, 01:51 AM
RE: Lua hooks needed! - by xoft - 06-06-2012, 02:13 AM
RE: Lua hooks needed! - by Taugeshtu - 06-06-2012, 02:19 AM
RE: Lua hooks needed! - by FakeTruth - 06-06-2012, 03:17 AM
RE: Lua hooks needed! - by Taugeshtu - 06-08-2012, 04:27 AM
RE: Lua hooks needed! - by xoft - 06-08-2012, 04:35 AM
RE: Lua hooks needed! - by Taugeshtu - 06-08-2012, 05:04 AM
RE: Lua hooks needed! - by xoft - 06-08-2012, 06:39 AM
RE: Lua hooks needed! - by Taugeshtu - 06-08-2012, 07:14 AM
RE: Lua hooks needed! - by xoft - 06-13-2012, 07:40 AM
RE: Lua hooks needed! - by Taugeshtu - 06-14-2012, 05:48 AM
RE: Lua hooks needed! - by FakeTruth - 06-14-2012, 07:03 AM
RE: Lua hooks needed! - by xoft - 06-14-2012, 06:18 AM
RE: Lua hooks needed! - by Taugeshtu - 06-14-2012, 06:22 AM
RE: Lua hooks needed! - by xoft - 06-14-2012, 06:29 AM
RE: Lua hooks needed! - by Taugeshtu - 06-14-2012, 08:54 AM
RE: Lua hooks needed! - by FakeTruth - 06-14-2012, 09:48 AM
RE: Lua hooks needed! - by xoft - 06-14-2012, 03:44 PM
RE: Lua hooks needed! - by Taugeshtu - 06-14-2012, 08:44 PM
RE: Lua hooks needed! - by xoft - 06-15-2012, 12:05 AM
RE: Lua hooks needed! - by FakeTruth - 06-15-2012, 01:11 AM
RE: Lua hooks needed! - by Taugeshtu - 06-15-2012, 01:58 AM
RE: Lua hooks needed! - by xoft - 06-15-2012, 03:06 AM
RE: Lua hooks needed! - by Taugeshtu - 06-15-2012, 03:13 AM
RE: Lua hooks needed! - by xoft - 06-15-2012, 03:31 AM
RE: Lua hooks needed! - by Taugeshtu - 09-02-2012, 03:34 AM
RE: Lua hooks needed! - by xoft - 09-02-2012, 07:20 AM
RE: Lua hooks needed! - by FakeTruth - 09-02-2012, 08:47 AM
RE: Lua hooks needed! - by xoft - 01-06-2013, 05:29 AM
RE: Lua hooks needed! - by bearbin - 01-06-2013, 06:00 AM
RE: Lua hooks needed! - by xoft - 01-06-2013, 06:34 AM
RE: Lua hooks needed! - by xoft - 01-06-2013, 07:34 AM
RE: Lua hooks needed! - by bearbin - 01-06-2013, 09:15 PM
RE: Lua hooks needed! - by xoft - 01-07-2013, 05:49 AM
RE: Lua hooks needed! - by NiLSPACE - 01-06-2013, 11:13 PM
RE: Lua hooks needed! - by FakeTruth - 01-07-2013, 01:51 AM
RE: Lua hooks needed! - by Luksor - 01-07-2013, 02:22 AM
RE: Lua hooks needed! - by xoft - 01-07-2013, 05:53 AM
RE: Lua hooks needed! - by NiLSPACE - 01-07-2013, 02:18 AM
RE: Lua hooks needed! - by bearbin - 01-07-2013, 05:53 AM
RE: Lua hooks needed! - by bearbin - 01-07-2013, 06:30 AM
RE: Lua hooks needed! - by Taugeshtu - 01-07-2013, 07:51 AM
RE: Lua hooks needed! - by NiLSPACE - 01-07-2013, 11:49 PM
RE: Lua hooks needed! - by bearbin - 01-08-2013, 04:25 AM
RE: Lua hooks needed! - by xoft - 01-08-2013, 03:03 PM
RE: Lua hooks needed! - by bearbin - 01-08-2013, 05:36 PM
RE: Lua hooks needed! - by Luksor - 01-10-2013, 01:58 AM
RE: Lua hooks needed! - by bearbin - 01-10-2013, 03:08 AM
RE: Lua hooks needed! - by NiLSPACE - 01-10-2013, 03:16 AM
RE: Lua hooks needed! - by bearbin - 01-10-2013, 03:27 AM
RE: Lua hooks needed! - by xoft - 01-10-2013, 08:18 PM
RE: Lua hooks needed! - by Luksor - 01-11-2013, 06:10 AM
RE: Lua hooks needed! - by xoft - 01-11-2013, 07:21 PM
RE: Lua hooks needed! - by bearbin - 01-12-2013, 02:38 AM
RE: Lua hooks needed! - by xoft - 01-12-2013, 02:58 PM
RE: Lua hooks needed! - by xoft - 01-13-2013, 09:13 PM
RE: Lua hooks needed! - by bearbin - 01-14-2013, 05:37 AM
RE: Lua hooks needed! - by xoft - 01-14-2013, 06:10 PM
RE: Lua hooks needed! - by bearbin - 01-14-2013, 11:42 PM
RE: Lua hooks needed! - by Taugeshtu - 01-19-2013, 02:51 AM
RE: Lua hooks needed! - by bearbin - 01-19-2013, 02:52 AM
RE: Lua hooks needed! - by xoft - 01-19-2013, 04:19 AM
RE: Lua hooks needed! - by xoft - 01-20-2013, 07:32 PM
RE: Lua hooks needed! - by NiLSPACE - 01-20-2013, 08:24 PM
RE: Lua hooks needed! - by bearbin - 01-21-2013, 01:40 AM
RE: Lua hooks needed! - by xoft - 01-21-2013, 06:43 PM
RE: Lua hooks needed! - by FakeTruth - 01-21-2013, 11:23 PM
RE: Lua hooks needed! - by xoft - 01-22-2013, 05:13 PM
RE: Lua hooks needed! - by FakeTruth - 01-23-2013, 02:13 AM
RE: Lua hooks needed! - by xoft - 02-01-2013, 07:45 PM
RE: Lua hooks needed! - by Taugeshtu - 02-01-2013, 07:58 PM
RE: Lua hooks needed! - by xoft - 02-01-2013, 09:08 PM
RE: Lua hooks needed! - by xoft - 02-06-2013, 05:57 AM
RE: Lua hooks needed! - by xoft - 02-12-2013, 05:51 PM
RE: Lua hooks needed! - by bearbin - 02-13-2013, 02:23 AM
RE: Lua hooks needed! - by NiLSPACE - 02-13-2013, 06:40 AM
RE: Lua hooks needed! - by xoft - 02-13-2013, 07:00 AM
RE: Lua hooks needed! - by NiLSPACE - 02-13-2013, 07:21 AM
RE: Lua hooks needed! - by xoft - 02-14-2013, 05:26 AM
RE: Lua hooks needed! - by NiLSPACE - 02-14-2013, 05:36 AM
RE: Lua hooks needed! - by xoft - 02-14-2013, 05:57 AM
RE: Lua hooks needed! - by NiLSPACE - 02-14-2013, 06:01 AM
RE: Lua hooks needed! - by xoft - 02-14-2013, 06:09 AM
RE: Lua hooks needed! - by xoft - 02-15-2013, 06:57 AM
RE: Lua hooks needed! - by NiLSPACE - 02-15-2013, 07:04 AM
RE: Lua hooks needed! - by xoft - 02-15-2013, 07:33 AM
RE: Lua hooks needed! - by Taugeshtu - 02-15-2013, 06:53 PM
RE: Lua hooks needed! - by xoft - 02-15-2013, 07:46 PM
RE: Lua hooks needed! - by NiLSPACE - 02-17-2013, 08:49 PM
RE: Lua hooks needed! - by FakeTruth - 02-17-2013, 10:23 PM
RE: Lua hooks needed! - by NiLSPACE - 02-18-2013, 03:37 AM
RE: Lua hooks needed! - by FakeTruth - 02-18-2013, 06:41 AM
RE: Lua hooks needed! - by NiLSPACE - 02-18-2013, 06:51 AM
RE: Lua hooks needed! - by FakeTruth - 02-18-2013, 07:05 AM
RE: Lua hooks needed! - by NiLSPACE - 02-18-2013, 07:10 AM
RE: Lua hooks needed! - by xoft - 02-18-2013, 08:17 AM
RE: Lua hooks needed! - by NiLSPACE - 02-20-2013, 03:09 AM
RE: Lua hooks needed! - by NiLSPACE - 02-20-2013, 05:07 AM
RE: Lua hooks needed! - by xoft - 02-20-2013, 06:06 AM
RE: Lua hooks needed! - by NiLSPACE - 02-20-2013, 06:25 AM
RE: Lua hooks needed! - by xoft - 02-20-2013, 04:27 PM
RE: Lua hooks needed! - by NiLSPACE - 02-20-2013, 07:57 PM
RE: Lua hooks needed! - by xoft - 02-20-2013, 10:49 PM
RE: Lua hooks needed! - by NiLSPACE - 02-20-2013, 11:07 PM
RE: Lua hooks needed! - by FakeTruth - 02-21-2013, 05:20 AM
RE: Lua hooks needed! - by NiLSPACE - 02-21-2013, 05:23 AM
RE: Lua hooks needed! - by xoft - 02-21-2013, 11:51 PM
RE: Lua hooks needed! - by NiLSPACE - 02-22-2013, 12:04 AM
RE: Lua hooks needed! - by xoft - 02-22-2013, 12:20 AM
RE: Lua hooks needed! - by NiLSPACE - 03-20-2013, 04:51 AM
RE: Lua hooks needed! - by xoft - 03-20-2013, 05:56 AM
RE: Lua hooks needed! - by NiLSPACE - 03-20-2013, 06:23 AM
RE: Lua hooks needed! - by xoft - 03-20-2013, 06:25 AM
RE: Lua hooks needed! - by NiLSPACE - 04-07-2013, 09:37 PM
RE: Lua hooks needed! - by xoft - 04-08-2013, 05:32 PM
RE: Lua hooks needed! - by NiLSPACE - 04-08-2013, 11:29 PM
RE: Lua hooks needed! - by xoft - 04-09-2013, 01:09 AM
RE: Lua hooks needed! - by NiLSPACE - 05-25-2013, 04:40 AM
RE: Lua hooks needed! - by xoft - 05-25-2013, 05:54 AM
RE: Lua hooks needed! - by NiLSPACE - 05-25-2013, 06:44 AM
RE: Lua hooks needed! - by NiLSPACE - 07-04-2013, 09:59 PM
RE: Lua hooks needed! - by xoft - 07-05-2013, 12:49 AM



Users browsing this thread: 3 Guest(s)