Added method to wait until sleep function is in reality sleeping#2617
Conversation
|
How i can rerun tests? |
|
Push some changes, but doesn't the sleeping duration vary with the server's TPS? |
Yes, but the idea is not to get the sleeping duration, only they detect if bot are sleeping or not, |
|
Seems this PR break the test of sleep, checking.. |
…conds, only return an error when over 3 seconds is not sleeping
|
@amoraschi done! I think now is much better, (See code) the sleep function waits until the sleep event is triggered, If there is no error and the event is not triggered then it returns an error indicating that it has not been able to sleep I removed in the test "await once(bot, 'sleep')" because sleep now wait to this trigger |
amoraschi
left a comment
There was a problem hiding this comment.
Promise should reject instead of resolve inside the setTimeout
|
Thanks |
Versions
Detailed description of a problem
If the bot click on bed at same time when other bot/player click on bed and steal him they don't return any error,
The function no return an error
I attach video you can see a bit better: https://youtu.be/S5PrYqO4KRk
Expected behavior
Throw an error