Hook Question
#11
No, but we could make a new hook for this packet, I guess.
Reply
Thanks given by: NiLSPACE
#12
That would be realy usefull Wink
Reply
Thanks given by:
#13
Should I put it in the bugtracker?
Reply
Thanks given by:
#14
yea, why not. Why, you can even implement it Smile
Reply
Thanks given by:
#15
Here is my first try:
.patch   OnPlayerSwingLeftArm.patch (Size: 5.25 KB / Downloads: 242) . Github just doesn't seem to like me very much ;( All I need now is that the hook only gets called when the left arm is swinging.
Reply
Thanks given by:
#16
Almost. The hook is called for actions other than arm-swinging as well. Either the cClientHandle::HandleAnimation() should check the param, and call the hook only for arm swinging, or the hook should be renamed to OnPlayerAnimation and it should get the parameter as well.

As for GitHub, what git client are you using? If commandline git, then just execute "git checkout -b SwingArmHook", this will create a new branch and switch to it; then you commit normally, and finally after you push to the server (preferably using "git gui"), the GitHub web will provide you with the link to create a pull request.
Reply
Thanks given by:
#17
I adapted your patch and committed it to master.
Reply
Thanks given by: NiLSPACE , bearbin
#18
Maybe an OnRandomBlockTick hook could be usefull for some people. It gets called when a block gets randomy updated (for example with crops growth)
Parameters:
  • World - The world where the tick is occurring
  • Coordinates - BlockX, BlockY and BlockZ
With this hook people could create for example an plugin that makes mossy cobblestone grow.
Reply
Thanks given by:
#19
I fear that such a hook would seriously affect the server performance - it would be called several thousand times per tick (there are about 50 ticked blocks per loaded chunk per tick; a player normally loads 19*19 chunks -> 18k hook calls per player). We might have to accept that *some* kinds of plugins are just unreachable with current architecture.
Reply
Thanks given by: NiLSPACE
#20
Wow several thousands times per tick ;O i gues you're right ;( it's hard to do that without a big performance drop.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)