Skip to content

Instantly share code, notes, and snippets.

@SpaceManiac
Created February 28, 2014 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpaceManiac/9262735 to your computer and use it in GitHub Desktop.
Save SpaceManiac/9262735 to your computer and use it in GitHub Desktop.
Comment on BlockPlacementHandler regarding double-packet behavior
/**
* The client sends this packet for the following cases:
* Right click air:
* - Send direction=-1 packet for any non-null item
* Right click block:
* - Send packet with all values filled
* - If client DOES NOT expect a block placement to result:
* - Send direction=-1 packet (unless item is null)
*
* Client will expect a block placement to result from blocks and from
* certain items (e.g. sugarcane, sign). We *could* opt to trust the
* client on this, but the server's view of events (particularly under
* the Bukkit API, or custom ItemTypes) may differ from the client's.
*
* In order to avoid firing two events for one interact, the two
* packet case must be handled here. Care must also be taken that a
* right-click air of an expected-place item immediately after is
* not considered part of the same action.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment