Item click-through, version 3
SlimeDog opened this issue · 8 comments
Spigot 1.15 (Jenkins 2517)
ItemJoin 5.0.6-b346
IronDoors 1.1
If I right-click my ItemJoin item (which opens a DeluxeMenus menu) while looking at an iron_door or iron_trapdoor, the door is toggled. I think that it should not be, given the cancel-events flag:
itemflags: cancel-events, death-drops, hide-attributes, hide-durability, inventory-modify, placement, self-drops, unbreakable
In my previous Skript version of open-door, I explicitly canceled the event (see #225). But apparently IronDoors doesn't, and I'm not sure that it should. Any ideas?
On further testing, I think the issue is with ItemJoin. The Skript has the same problem now, which used to work correctly.
on rightclick on iron door:
if event is not cancelled:
toggle the event-block
cancel the event
ItemJoin should be cancelling the event, with the flag
itemflags: cancel-events, death-drops, hide-attributes, hide-durability, inventory-modify, placement, self-drops, unbreakable
Hey, yes sorry for the slow reply I have been fairly busy.
-- I have narrowed down the issue to be with Skript, I am unsure why so I have been trying to get in contact with the developer. I believe it has something to do specifically with the iron door whether the name for initialization has changed etc. In previous versions of Skript (with the latest ItemJoin version) this does not happen. But upon downloading the latest Skript version this issue appears.
OK and thanks. If you can get that resolved, I will go back to using Skript. However, it is also a problem with IronDoors. Any ideas about that?
Sorry for the slow reply, I would have to look at the plugin myself to see. Oddly I cannot find it for some reason :/
Could you link it please?
Okay so, I can confirm this is an issue with IronDoors. Their event is setup without any priority which makes it difficult for other plugins to cancel the event to prevent it from passing to the other plugin, typically requiring us to put our event state to monitor which is against the conventional use.
It should also be noted that the event was also not being canceled because the event is being triggered twice since as of the Combat Update, the PlayerInteractEvent executes for both offhand and main hand at the same time. ItemJoin was only set to cancel the main hand.
If you want you can contact the developer for this fix;
Add a precheck to the code before it is run as; if (!event.isCancelled())
however, this is a deprecated method and may not be supported for long.
Since IronDoors is open source I resolved the issue; https://www.dropbox.com/s/7t497ads0m24mye/IronDoors.jar?dl=0
ItemJoin snapshot for canceling both events; http://ci.craftationgaming.com/job/ItemJoin/361/