Slimefun

Slimefun

3M Downloads

MultiBlockInteractEvent setCancelled not work

andris155 opened this issue ยท 2 comments

commented

๐Ÿ“ Description (REQUIRED)

The MultiBlockInteractEvent setCancelled not work.
I try disable the MultiBlock machines in creative mode, but the e.setCancelled(true) not working. The multiblock machines still works.

๐Ÿ“‘ Steps to reproduce the Issue (REQUIRED)

Use the MultiBlockInteractEvent api and setup the e.setCancelled(true).

๐Ÿ’ก Expected behavior (REQUIRED)

MultiBlockInteractEvent setCancelled(true) works, and if true, the multiblocks machines no usable.

๐Ÿ“œ Server Log

๐Ÿ“‚ /error-reports/ Folder

https://pastebin.com/EMqzZuNi

๐Ÿงญ Environment (REQUIRED)

Yatopia git-Yatopia-"f8c5c21" (MC: 1.16.5)
Slimefun DEV - 812 (git 47743b6)
Metrics-Module #21
Java 11

Installed Addons: (2)
RestrictedCreative v2.4.6
SlimefunFix v1.1-SNAPSHOT

commented

The event is named interact rather then use so I understand why it may not block usage.

However, it is a cancellable event so it isn't doing what it should regardless.
The interact handler is currently firing before the event and event result is ignored.
Ref: https://github.com/Slimefun/Slimefun4/blob/master/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/MultiBlockListener.java#L65-L66

This event name indicates it's pre really and since it's cancellable it should do something.

commented

Big thanks for this. :)