Open tal5 opened 1 year ago
I would prefer to have the javadocs changed to reflect that behavior instead of breaking plugins...
I disagree, this really does not seem like intended behavior. But at the same time, this event's current implementation makes stuff like that very confusing.
even if it was not intended, it is the only useful event atm (also for waxing, unwaxing, log stripping,.. - playerinteract does not have the resulting change result so it is quite bad to use for this), so it would break nearly every protection plugin if it is changed.
and if it is documented it can be made intended behavior.
100% agree with brokkonaut here.
While this is - as others have said - not the intended way, it is currently also the only way to track such things. So if we decide to add special events for those cases we should probably not change the old behavior but instead add a note to the BPE that goes like this:
"While this event is also triggered on placing books into lecterns, waxing and striping, it is highly recommend to use the appropriate events to handle such interactions"
I have looked into this for a while and discovered that we can just create a CraftItemStack
out of the used item and check if it is an actual block. That should fix the issue with lecterns and copper blocks.
But what are we doing now?
Stuff like this shouldn't really be intended behavior as it makes no sense, new API should be added instead. In this case there's already a PR open that adds an insert book event
There were never talks about whether it should be considered intended behavior or not.
Talks currently are at that point that several people said that the current BlockPlaceEvent
should be declared as deprecated due to its inconsistency and to introduce a new event.
Expected behavior
The JD for the block place event says
Called when a block is placed by a player.
, so either for the event to not fire there or for the JD to be clarified.Observed/Actual behavior
Whenever you place a book into a Lectern, a block place event is fired.
Steps/models to reproduce
This is using the Debuggery plugin (which is part of Paper's org), let me know if proper Java code is preferred.
/devent org.bukkit.event.block.BlockPlaceEvent
Plugin and Datapack List
Paper version
Other
Some Discord discussion if that's relevant.