BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

box settings given players free items

Open wschris1 opened this issue 1 year ago • 7 comments

Expected behavior

For the items to not be given from the menu

Observed/Actual behavior

Items are given from the menu

Steps/models to reproduce

Fill up your hotbar with any block ext: 9 dirt Do /box settings go on expert mode click 1-9 on your keyboard while hovering over an item on the menu it will give you the item that you now selected in your hotbar

https://github.com/user-attachments/assets/fd9975f3-3db2-4f80-a809-19dd2242ab67

BentoBox version

2.4.0-SNAPSHOT-b2651

Plugin list

Other

No response

wschris1 avatar Jul 15 '24 23:07 wschris1

After doing a binary test, I determined this root cause is StackableItems https://github.com/haveric/StackableItems

I cannot find any other menus that exhibit this behavior with StackableItems installed, is there anything different about how BentoBox handles the box settings menu that could cause the items to be taken out when the server has StackableItems installed?

wschris1 avatar Jul 16 '24 00:07 wschris1

I believe because BentoBox's priority for the inventory click event is set to highest

Projecki avatar Jul 16 '24 01:07 Projecki

Or maybe the issue is that they are listening for cancelled events? BentoBox cancels it, and they still use it? Not 100% sure tho...

BONNe avatar Jul 16 '24 05:07 BONNe

@tastybento , we could change to the same level as DeluxeMenu is using: EventPriority.LOW

BONNe avatar Jul 16 '24 05:07 BONNe

It's because StackableItems also sets their inventory click listeners to HIGHEST so there can be a race condition where they and us run differently.

This happens every so often and I think we've change priority a few times but yes, in theory if we change to something, NORMAL or even MONITOR it should work. Let's see.

tastybento avatar Jul 16 '24 14:07 tastybento

Shifted the event priority to LOW.

tastybento avatar Jul 17 '24 05:07 tastybento

@wschris1 Can you confirm that this fixed the problem?

tastybento avatar Jul 18 '24 15:07 tastybento