Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jigsaw Interactions Cannot Be Cancelled With PlayerInteractionEvent #10709

Closed
ChillyTheEevee opened this issue May 12, 2024 · 4 comments · Fixed by #10719
Closed

Jigsaw Interactions Cannot Be Cancelled With PlayerInteractionEvent #10709

ChillyTheEevee opened this issue May 12, 2024 · 4 comments · Fixed by #10719
Labels
good first issue Simple bug fix or feature which would be a good first PR for someone new to the project status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.20.2 Game version 1.20.2

Comments

@ChillyTheEevee
Copy link

Expected behavior

When cancelling a PlayerInteractionEvent caused by an opped player in creative mode interacting with a Jigsaw block, one would expect the Jigsaw block GUI to not open on the player client's screen, as the event was cancelled.

Observed/Actual behavior

Instead, when the PlayerInteractionEvent related to the player (in creative mode) interacting with the jigsaw block is cancelled, the Jigsaw block's interface is still opened on the client. This is completely abnormal from what is expected when a PlayerInteractEvent is cancelled. For example:

  • When a PlayerInteractEvent relating to a player opening a furance is cancelled, the client does not open the furnace GUI
  • When a PlayerInteractEvent relating to a player opening a chest is cancelled, the client does not open the chest GUI
  • When a PlayerInteractEvent relating to a (creative mode) player opening a command block is cancelled, the client does not open the command block GUI

Steps/models to reproduce

  1. Create a small plugin that implements a Listener similar to the one below to cancel all PlayerInteractEvents
    @eventhandler
    public void onPlayerInteractEvent(PlayerInteractEvent event) {
    event.setCancelled(true);
    }
  2. Throw that plugin onto a server and boot it. While the server is running, every single PlayerInteractEvent should be cancelled.
  3. Make sure you are listed as an operator and in creative mode.
  4. Attempt to interact with a Jigsaw block.
  5. Note that the Jigsaw block interface is still opened (even though all PlayerInteractEvents are being cancelled)

Plugin and Datapack List

I am running no plugins other than the one listed above for canceling all PlayerInteractEvents.
I am using no data packs.

Paper version

This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous version: git-Paper-307 (MC: 1.19.2)

Other

No response

@ChillyTheEevee ChillyTheEevee added status: needs triage type: bug Something doesn't work as it was intended to. labels May 12, 2024
@papermc-sniffer papermc-sniffer bot added the version: 1.20.2 Game version 1.20.2 label May 12, 2024
@Owen1212055 Owen1212055 added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. good first issue Simple bug fix or feature which would be a good first PR for someone new to the project and removed status: needs triage labels May 12, 2024
@electronicboy
Copy link
Member

The inventory opening occurs on the client, this would need to basically be one of those special cases to just force close the inventory if we want to deal with this

@Owen1212055
Copy link
Member

There is a condition that currently covers command blocks / structure blocks only.

@ChillyTheEevee
Copy link
Author

Could that condition be easily extended to cover jigsaw blocks as well?

@Owen1212055
Copy link
Member

Yes, PRS welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Simple bug fix or feature which would be a good first PR for someone new to the project status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.20.2 Game version 1.20.2
Projects
Status: Done
3 participants