API change: OnPlayerPlacingBlock / OnPlayerPlacedBlock
#11
No I can live with it. Adding the BlockFace parameter does make sense for me, but isn't necessary.
Reply
Thanks given by:
#12
Oh my, this is a bigger change than I anticipated. I'll have to change quite a few BlockHandlers and ItemHandlers to make things right.

Take the bed item handler, for example. Currently, it only places the "sheets" block and lets the blockhandler for the bed block handle placing the "pillow" block. This is however against the design I'm making here - if the placement of the "pillow" block is refused by the plugins, the "sheets" block should not be placed either. So I need to make the bed item handler place both blocks *at once* (atomically), so that the events are like this:
1. Hook call: OnPlayerPlacingBlock("sheets")
2. Hook call: OnPlayerPlacingBlock("pillow")
3. Set the "sheets" block
4. Set the "pillow" block
5. Hook call: OnPlayerPlacedBlock("sheets")
6. Hook call: OnPlayerPlacedBlock("pillow")
Now, if a plugin refuses step 2, neither of the blocks will be placed.

This means a complete rewrite of the cItemHandler::GetPlacementBlockTypeMeta() into another function, PlayerPlace()
Reply
Thanks given by:
#13
Why do I always pick the worst tasks to implement? This has grown into such a monster thing again...
Basically I need to rewrite all blocks' OnPlacedByPlayer() handlers. Which means reimplementing from ground up: slabs turning into double-slabs, beds, doors, chests checking against triple-chests, skull placement creating a wither, pumpkin placement creating a snowgolem, etc.
Reply
Thanks given by:
#14
Quote:Why do I always pick the worst tasks to implement?

'Cause you're the best qualified to do so, of course.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)