Hook Bugs?
#1
I have encountered what I think are bugs with OnBlockPlace() and OnBlockBreak().

OnBlockBreak() seems to fire multiple times. (Particuarly in survival mode). If this fires every time a block damage packet comes in and is intended, can we have a OnBlockBroken() hook?

OnBlockPlace does not stop a block from being removed from the hand when the event is cancelled.
Reply
Thanks given by:
#2
OnBlockBreak() is really called whenever the client sends a BlockBreak packet. The packet might have only some info updated (the blockface U / V coords, for example).

What we need is an API refactoring, we have already discussed it and we decided we'll get a set of hooks whose names would more descriptive: OnRightClick, OnLeftClick for whenever the packet arrives, OnBlockPlacing / OnBlockPlaced when a block is being placed, OnBlockBreaking / OnBlockBroken when a block is being broken, OnUseEntity when an entity has been rclked, etc. Just no-one got around to actually implement thatTongue
I'm still on vacation, and will be for one more month (yay New Zealand) and FakeTruth is away on vacation, too, so it's now up to you, if you want it really badly Wink
Reply
Thanks given by:
#3
I've added a new plugin that is aimed at developers, it's called HookNotify, and it logs every hook being called (except for OnTick() - there's too many of them) and all its parameters' types and values. When developing a new plugin, or debugging an existing one, it might prove useful, since it gives you the answer for questions such as "what are the parameters", "does the hook really get called" etc.
Reply
Thanks given by: bearbin




Users browsing this thread: 1 Guest(s)