From d46f7ce2c880026ff4663d89d3e76117219b87a2 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 31 Jul 2016 21:54:35 +0100 Subject: Redstone fixes (#3285) * Comparators and pistons no longer update instantly * Fixes #3168. * Consolidated comparator code * As a result, fixed an issue where GetPowerLevel didn't consider block entities behind it (only GetFrontPowerLevel did) --- src/Blocks/BlockComparator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Blocks/BlockComparator.h') diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h index 394b53a15..5ba17c691 100644 --- a/src/Blocks/BlockComparator.h +++ b/src/Blocks/BlockComparator.h @@ -60,6 +60,16 @@ public: return true; } + inline static bool IsInSubtractionMode(NIBBLETYPE a_Meta) + { + return ((a_Meta & 0x4) == 0x4); + } + + 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; -- cgit v1.2.3