summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockHandler.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h
index 13c3a84af..772536003 100644
--- a/src/Blocks/BlockHandler.h
+++ b/src/Blocks/BlockHandler.h
@@ -73,24 +73,15 @@ public:
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, const sSetBlock & a_BlockChange
) const {}
- /** Called just after the player breaks the block.
+ /** Called after a block gets broken (replaced with air), by natural means.
The block is already dug up in the world, the original block type and meta is passed in a_OldBlockType and a_OldBlockMeta.
- By default does nothing special, descendants may provide further behavior. */
- virtual void OnPlayerBrokeBlock(
- cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
- cPlayer & a_Player,
- Vector3i a_BlockPos,
- BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
- ) const {}
-
- /** Called after a block gets broken (replaced with air), either by player or by natural means.
- If by player, it is called before the OnPlayerBrokeBlock() callback.
- The block is already dug up in the world, the original block type and meta is passed in a_OldBlockType and a_OldBlockMeta.
- By default notifies all direct neighbors via their OnNeighborChanged() callbacks. */
+ By default notifies all direct neighbors via their OnNeighborChanged() callbacks.
+ You can determine what kind of entity broke the block (e.g. player) by checking a_Digger! */
virtual void OnBroken(
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
Vector3i a_BlockPos,
- BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
+ BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta,
+ const cEntity * a_Digger
) const {}
/** Called when a direct neighbor of this block has been changed.