From e2d88106a9558d26d3cb8b05ac6ade6aca088737 Mon Sep 17 00:00:00 2001 From: bibo38 Date: Mon, 2 Nov 2015 22:12:58 +0100 Subject: Added the CanPushBlock method for the piston push check. This allows the recursive check for blocks to push, which is needed to implement the slime blocks into the piston system. --- src/Blocks/BlockPiston.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Blocks/BlockPiston.h') diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h index 56f7f9951..41ef79aa6 100644 --- a/src/Blocks/BlockPiston.h +++ b/src/Blocks/BlockPiston.h @@ -3,6 +3,8 @@ #include "BlockHandler.h" +#include + class cWorld; @@ -152,8 +154,11 @@ private: return CanPush(a_BlockType, a_BlockMeta); } - /** Returns how many blocks the piston has to push (where the first free space is); < 0 when unpushable */ - static int FirstPassthroughBlock(int a_PistonX, int a_PistonY, int a_PistonZ, NIBBLETYPE a_PistonMeta, cWorld * a_World); + /** Tries to push a block and increases the pushed blocks variable. Returns true if the block is pushable */ + static bool CanPushBlock( + int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World, bool a_RequirePushable, + std::unordered_set> & a_BlocksPushed, NIBBLETYPE a_PistonMeta + ); } ; -- cgit v1.2.3