Slimefun

Slimefun

3M Downloads

When drinking use and quickly switching ithe item slots to another, both juices get consumed and the player recieves a singular glass blottle

marvjosh1 opened this issue · 4 comments

commented

❗ Checklist

  • I am using the official english version of Slimefun and did not modify the jar.
  • I am using an up to date "DEV" (not "RC") version of Slimefun.
  • I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
  • I searched for similar open issues and could not find an existing bug report on this.

📍 Description

When drinking a juice and in the last instance of drinking it switching to another hotbar slot with a juice, bot get consumed and the player recieves a glass bottle.

📑 Reproduction Steps

  1. Place 2 juices in your inventory
  2. Start drinking one of them
  3. The last minute before the player is finishing drinking it, switch to the hotbar slot with the other juice

💡 Expected Behavior

The expected behaviour is that only one of the juices would be consumed, and the player doesnt get a glass bottle from it.

📷 Screenshots / Videos

https://www.youtube.com/watch?v=GE1DBlG2I84

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Purpur

🎮 Minecraft Version

1.17.x

⭐ Slimefun version

https://i.imgur.com/Hgp4T9g.png
https://i.imgur.com/AuIoUYW.png

🧭 Other plugins

No response

commented

Yep, can confirm this. But the timing is quite hard for me to get it right lol.
https://youtu.be/sbAQN17qy68

commented

Did testing today, this seems to be the case.
I wanted to verify that not only juices could dissapear, but practially any item in your new slot.
https://youtu.be/suUhWw4eTaQ

commented

Your issue has been closed by an admin, it may fall under one or more of the following categories.
Please wait for an admin to tick off the points that apply.


  • You did not follow our template. Please follow the Issue template to help us identify your issue more effectively.
  • You did not provide any information about your versions (We absolutely need the exact version numbers that are installed on your Server, "latest" is not helpful)
  • You did not provide a proper description to the problem. Try to write at least 4-6 sentences and/or provide screenshots or videos on how to reproduce this.
  • We were unable to reproduce issue, if you think your issue still persists then please comment down below and give a better description on how to reproduce it.
  • Your issue was posted in a foreign language, we only accept english issues on here.
  • Your issue is not a bug, it is intended to work this way.
  • Your issue is not really a bug, it is a limitation or simply something we have no control over.
  • Your issue is not a bug, please only use this issue tracker to report bugs. Any other kind of communication should happen on discord.
  • Your issue has already been reported before, it is a duplicate. Check the other issues first before posting!
  • You posted an error without using pastebin. Please always post errors via pastebin otherwise they become nearly unreadable.
  • You seem to be reporting multiple bugs at once. Please make a separate issue for each bug you encountered, so we can properly handle them individually.
  • Your issue has already been fixed in a later version of Slimefun, you should update.
  • You are using an outdated and unsupported version of Slimefun, again, you should update.
  • You are using an unofficially modified build of Slimefun. We only support official versions of Slimefun - for obvious reasons.
  • You are using an unsupported version of Minecraft. We only provide support for the Minecraft versions Slimefun was developed for, older versions are not supported anymore.
  • You are using a "stable" version of Slimefun (prefixed with "RC - "), your issue may have been fixed in a development build, so we only accept bug reports from those.
  • You are on the wrong issue tracker. We would like to remind you that this Issue Tracker is only for Slimefun. To report bugs on any addons, head to the corresponding issue tracker of that addon.

Please respond below, if you have any further questions.
Do not open a new Issue unless explicitly told otherwise, comment below or edit your post instead.

Make sure to check out our article on How to report bugs for even more information.

commented

Looking at the code, it seems that this is caused by a timing issue due to Slimefun.runSync(), in which, when well timed, the code can enter a race in this form:

  • Juice handler verifies interaction, applies effect and goes to remove bottle
  • The function then calls runSync() to schedule the removal of the item in hand.
  • While the action is still being scheduled, the player switches exactly at that tick to another spot in the hotbar.
  • Minecraft does his thing with bottles, and replaces the old slot with the juice with an empty bottle.
  • runSync() activates, and erases item in hand.

This would explain why the timing would need to be very precise.
This is all pure hypothesis though, I will do actual testing tomorrow to see if this is the case.