diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-26 13:27:27 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-26 13:27:27 +0200 |
commit | ef4d68adfd70488df0887f3a5fba1c9aad7a0108 (patch) | |
tree | 1ea3acb0e6b16e8badf7d1d56301bf3dd3a5d99e /src/Blocks/BlockHandler.h | |
parent | Add armor items directly to the armor slots. (diff) | |
parent | Git: Ignore AllFiles.lst (generated by cmake) (diff) | |
download | cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.gz cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.bz2 cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.lz cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.xz cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.tar.zst cuberite-ef4d68adfd70488df0887f3a5fba1c9aad7a0108.zip |
Diffstat (limited to 'src/Blocks/BlockHandler.h')
-rw-r--r-- | src/Blocks/BlockHandler.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h index 7f23fc6ff..de90ce55b 100644 --- a/src/Blocks/BlockHandler.h +++ b/src/Blocks/BlockHandler.h @@ -60,25 +60,29 @@ public: virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ); /// Called when a direct neighbor of this block has been changed (The position is the own position, not the neighbor position) - virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ); + virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) {} /// Notifies all neighbors of the given block about a change static void NeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ); /// Called while the player diggs the block. - virtual void OnDigging(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ); + virtual void OnDigging(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) {} /// Called if the user right clicks the block and the block is useable - virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ); + virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) {} - /** Called when a Right Click to this Block is cancelled */ - virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace); + /** Called when a right click to this block is cancelled */ + virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) {} /// <summary>Called when the item is mined to convert it into pickups. Pickups may specify multiple items. Appends items to a_Pickups, preserves its original contents</summary> virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta); - /// Handles the dropping of a block based on what ConvertToDrops() returns. This will not destroy the block. a_Digger is the entity causing the drop; it may be NULL - virtual void DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ); + /** Handles the dropping, but not destruction, of a block based on what ConvertTo(Verbatim)Pickups() returns, including the spawning of pickups and alertion of plugins + @param a_Digger The entity causing the drop; it may be NULL + @param a_CanDrop Informs the handler whether the block should be dropped at all. One example when this is false is when stone is destroyed by hand + @param a_DropVerbatim Calls ConvertToVerbatimPickups() instead of its counterpart, meaning the block itself is dropped by default (due to a speical tool or enchantment) + */ + virtual void DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, bool a_CanDrop = true, bool a_DropVerbatim = false); /// Returns step sound name of block virtual const char * GetStepSound(void); |