-
Notifications
You must be signed in to change notification settings - Fork 37
OnPlayerPostRunCommand #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think internally doing twice the work to provide a post listener would worth the effort and extra computing time it implies to be honest. Making the majority of servers suffers that extra load for a listener that might be used by very few plugins that might have to handle that very specific case you mentioned doesn't seem like a good idea from an API standpoint. Especially considering you can already register your own post hook fairly easily: @EntityPostHook(EntityCondition.is_player, 'run_command')
def _post_run_command(stack_data):
player = make_object(Player, stack_data[0])
... |
Actually, it shouldn't really have a performance impact. The hook is already installed, so we would just add a post hook callback. Inside of this callback we would simply check if there are PostPlayerRunCommand callbacks. If there aren't any, we would simply quit the handler like we did here: So, if no plugin registers a PostPlayerRunCommand callback, there are only one or two very simple additional calls. |
Yes!!! Also as I know if I want it through standard EntityPostHook, I should to create the ecx storage otherwise the player pointer will be utilized. I have another problem without the post hook, when you entered in pre hook, gravity velocity (sv_gravity * server.tick_interval / 2.0) has already been added for some reason to player z axis. and maybe it would be better to do these things in post hook of previous tick. |
Let's add this, It's very useful when you want to change something after processed command, because, for example if you set a velocity in OnPlayerRunCommand, velocity from the tick will be processed anyway.
The text was updated successfully, but these errors were encountered: