01-10-2013, 08:18 PM
Luksor,
- Taking damage should have its hook, only its output is a bit different. That hook has been tested a while ago when I was implementing the damage value calculation (TakeDamageInfo rewrite, https://forum.cuberite.org/showthread.php?tid=625 ).
- Left click is triggerred everytime we get a packet from the client. If we don't get a packet, we cannot fire an event. You might want to check with ProtoProxy if the packet is being sent and somehow ignored in MCServer, but I doubt that. We don't even do the block interactions rate check before firing the event.
- Inventory manipulation is a good idea for hooks. Care to specify the API?
- Mob movement will definitely need to be covered, but I'd prefer to leave that until we have a decent mob AI, because then we might get a few extra events (OnMobTargetsPlayer() et al. )
- Water / lava flowing are kinda grey zone. The simulators are already slow and slowing them down even more with hooks would be quite dangerous. I know we might improve the simulator speed, but still this is about handling thousands, maybe tens of thousands hooks per second on a regular server.
- Blocks falling are a good idea. Even better, all entity operations - create entity, spawn entity, destroy entity - are good candidates for hooks. Unfortunately they might be a good source of deadlocks between plugins.
Generally, I'd like to first stabilize anything with the current set of hooks, then expand the set.
- Taking damage should have its hook, only its output is a bit different. That hook has been tested a while ago when I was implementing the damage value calculation (TakeDamageInfo rewrite, https://forum.cuberite.org/showthread.php?tid=625 ).
- Left click is triggerred everytime we get a packet from the client. If we don't get a packet, we cannot fire an event. You might want to check with ProtoProxy if the packet is being sent and somehow ignored in MCServer, but I doubt that. We don't even do the block interactions rate check before firing the event.
- Inventory manipulation is a good idea for hooks. Care to specify the API?
- Mob movement will definitely need to be covered, but I'd prefer to leave that until we have a decent mob AI, because then we might get a few extra events (OnMobTargetsPlayer() et al. )
- Water / lava flowing are kinda grey zone. The simulators are already slow and slowing them down even more with hooks would be quite dangerous. I know we might improve the simulator speed, but still this is about handling thousands, maybe tens of thousands hooks per second on a regular server.
- Blocks falling are a good idea. Even better, all entity operations - create entity, spawn entity, destroy entity - are good candidates for hooks. Unfortunately they might be a good source of deadlocks between plugins.
Generally, I'd like to first stabilize anything with the current set of hooks, then expand the set.