pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.56k forks source link

Fast eat (Trying to drop while eating food even the PlayerDropItemEvent getting cancel) #4936

Open ItsZodiaX opened 2 years ago

ItsZodiaX commented 2 years ago

Issue description

Steps to reproduce the issue

  1. Hold right-click to eat food
  2. Press Q to drop food

OS and versions

Plugins

Plugins (2): DevTools v1.15.0+dev, Test v0.0.1

Crashdump, backtrace or other files

https://cdn.discordapp.com/attachments/878545340058468412/959086406486085732/2022-03-31_20-41-07_Trim.mp4

dktapps commented 2 years ago

I suppose the reason for this is because Player->isUsingItem() is still true due to the event being cancelled. When the client performs a drop, it sends a new item interaction regardless of whether the server actually performed that drop or not.

dktapps commented 2 years ago

Related to #4491

ItsZodiaX commented 2 years ago

I think https://github.com/pmmp/PocketMine-MP/issues/4491 got fixed already. I can't eat while dropping anymore but if you cancel PlayerDropItemEvent. It still happens

dktapps commented 2 years ago

Yes, I know it's fixed. But this bug has a similar cause to #4491 due to an incomplete solution.