From 0e0baa940a967b34806891c5d5e9d520b3a558db Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 30 Nov 2013 00:31:21 +0000 Subject: Properly fixed snow height, fixes #98 and #264 --- src/Blocks/BlockHandler.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/Blocks/BlockHandler.h') diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h index 81d9f240c..126930dc1 100644 --- a/src/Blocks/BlockHandler.h +++ b/src/Blocks/BlockHandler.h @@ -97,7 +97,10 @@ public: */ virtual bool DoesIgnoreBuildCollision(void); - /// Does this block drop if it gets destroyed by an unsuitable situation? Default: true + /// Similar to DoesIgnoreBuildCollision(void), but is used for cases where block meta/player item-in-hand is needed to determine collision (thin snow) + virtual bool DoesIgnoreBuildCollision(cPlayer * a_Player, NIBBLETYPE a_Meta) { return DoesIgnoreBuildCollision(); } + + /// Returns if this block drops if it gets destroyed by an unsuitable situation. Default: true virtual bool DoesDropOnUnsuitable(void); /** Called when one of the neighbors gets set; equivalent to MC block update. @@ -106,26 +109,30 @@ public: */ virtual void Check(int a_RelX, int a_RelY, int a_RelZ, cChunk & a_Chunk); - /// Returns the meta for a block after rotating it counter-clockwise from the specified meta. Default: no change + /// Rotates a given block meta counter-clockwise. Default: no change + /// Block meta following rotation virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) { return a_Meta; } - /// Returns the meta for a block after rotating it clockwise from the specified meta. Default: no change + /// Rotates a given block meta clockwise. Default: no change + /// Block meta following rotation virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) { return a_Meta; } - /// Returns the meta for a block after mirroring it around the XY plane. Default: no change + /// Mirros a given block meta around the XY plane. Default: no change + /// Block meta following mirroring virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) { return a_Meta; } - /// Returns the meta for a block after mirroring it around the XZ plane. Default: no change + /// Mirros a given block meta around the XZ plane. Default: no change + /// Block meta following mirroring virtual NIBBLETYPE MetaMirrorXZ(NIBBLETYPE a_Meta) { return a_Meta; } - /// Returns the meta for a block after mirroring it around the YZ plane. Default: no change + /// Mirros a given block meta around the YZ plane. Default: no change + /// Block meta following mirroring virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) { return a_Meta; } - - - /// Get the blockhandler for a specific block id + + /// Get the blockhandler for a specific block id static cBlockHandler * GetBlockHandler(BLOCKTYPE a_BlockType); - /// Deletes all initialised block handlers + /// Deletes all initialised block handlers static void Deinit(); protected: -- cgit v1.2.3