API change: OnPlayerPlacingBlock / OnPlayerPlacedBlock
#4
Because there's no blockface when placing the additional blocks. Consider the scenario of placing a door:
1. Client sends the BlockPlace packet
2. Server parses the packet, calls the packet-based hook (PLAYER_RIGHT_CLICK) with all the params
3. Server calls the door item handler to handle the placement
4. The door itemhandler calls PLAYER_PLACING_BLOCK hook for the lower part of the door (what the client sent)
5. The door itemhandler calls PLAYER_PLACING_BLOCK hook for the upper part of the door <-- There's no blockface available here!

The situation is quite similar with placing and scooping up liquids. There's no blockface for these in the packets.

The hook should simply inform that "the player is placing a block at these coords". If a plugin needs the blockface, it will need to process the lower packet - PLAYER_RIGHT_CLICK.
Reply
Thanks given by:


Messages In This Thread
RE: API change: OnPlayerPlacingBlock / OnPlayerPlacedBlock - by xoft - 11-30-2014, 05:22 AM



Users browsing this thread: 1 Guest(s)