Closed PssbleTrngle closed 6 days ago
I believe not sending the packet is intentional, but I would have to double check the forge patch
I very much believe it is not intentional or should at least not be, because it leads to the following problem:
1) When adding a custom interaction using the callback, the developer can either return null
on client side, causing the event to be propagated to the server (were it usually is meant to be because most of the logic is happening there).
2) Doing this will cause the client not to display the correct interaction animation (none at all)
3) it will also not only be the only way to get the EntityInteractCallback
to run on server-side, but also still run the default interaction logic on client side, since that is now not cancelled in any way
This is a proposed fix for #135
This changes the cancelation of the injected method to happen after the
ServerboundInteractPacket
has been send to the server instead of before. This means that returning a non-nullInteractionResult
on client now still triggers theEntityInteractCallback
on the server too instead of omitting it.I have also added an example callback to the test mod to check if this actually solves the issue, I have left it in, but can also remove it again if you want to.