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

Fire PlayerInteractEvent on client + more changes #1121

Closed

Conversation

copygirl
Copy link

@copygirl copygirl commented Jun 4, 2014

This pull request makes PlayerInteractEvent more consistent and useful, mostly making the event available on the client. The following changes are included:

  • PlayerInteractEvent fires on the client.
    • Cancelling the event on the client will prevent packets from being sent to the server.
    • Setting useItem to DENY on the client will make blocks appear unbreakable.
  • Setting useItem to ALLOW will allow blocks to be broken even in adventure mode.
  • Right clicking air without an item will send a packet to the server, causing a right click air event.
  • Left click block will fire regardless of game mode, as long as the block isn't broken instantly.

And as a little added bonus:

  • Added "documentation" to PlayerInteractEvent.
  • Fires PlayerDestroyItemEvent on client too when item is used up in onItemUseFirst.
  • Current item is not wrongly set to null on client if the passed item has a stack size of 0, even though the current item was set to a new stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant