From 04cc8aa0f57ac3fb3293740d4ffd741231d5925d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 5 Jun 2016 16:08:47 +0100 Subject: Comparators and pistons no longer update instantly * Fixes #3168. --- src/Blocks/BlockComparator.h | 5 +++++ src/Blocks/BlockPiston.h | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h index 394b53a15..ffd1bde61 100644 --- a/src/Blocks/BlockComparator.h +++ b/src/Blocks/BlockComparator.h @@ -60,6 +60,11 @@ public: return true; } + inline static bool IsOn(NIBBLETYPE a_Meta) + { + return ((a_Meta & 0x8) == 0x8); + } + inline static Vector3i GetSideCoordinate(const Vector3i & a_Position, NIBBLETYPE a_Meta, bool a_bInverse) { auto Position = a_Position; diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h index 30ccc168d..18b688256 100644 --- a/src/Blocks/BlockPiston.h +++ b/src/Blocks/BlockPiston.h @@ -93,6 +93,9 @@ public: return 11; } + /** Returns true if the piston (with the specified meta) is extended */ + static inline bool IsExtended(NIBBLETYPE a_PistonMeta) { return ((a_PistonMeta & 0x8) != 0x0); } + private: typedef std::unordered_set> Vector3iSet; @@ -100,9 +103,6 @@ private: /** Returns true if the piston (specified by blocktype) is a sticky piston */ static inline bool IsSticky(BLOCKTYPE a_BlockType) { return (a_BlockType == E_BLOCK_STICKY_PISTON); } - /** Returns true if the piston (with the specified meta) is extended */ - static inline bool IsExtended(NIBBLETYPE a_PistonMeta) { return ((a_PistonMeta & 0x8) != 0x0); } - /** Returns true if the specified block can be pushed by a piston (and left intact) */ static inline bool CanPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { -- cgit v1.2.3