diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-13 00:54:11 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-13 00:54:11 +0200 |
commit | 4b093972ea139d057dd523b583352be69bae7edb (patch) | |
tree | 1bc8edf1594f4c81bbdd6a68cf7d22f5a2b21341 /src/Blocks/BlockPiston.h | |
parent | Add doxy-comments. (diff) | |
parent | Merge pull request #1154 from mc-server/trappedchests (diff) | |
download | cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.gz cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.bz2 cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.lz cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.xz cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.zst cuberite-4b093972ea139d057dd523b583352be69bae7edb.zip |
Diffstat (limited to 'src/Blocks/BlockPiston.h')
-rw-r--r-- | src/Blocks/BlockPiston.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h index e6fa48e54..27a44d829 100644 --- a/src/Blocks/BlockPiston.h +++ b/src/Blocks/BlockPiston.h @@ -104,6 +104,7 @@ private: case E_BLOCK_ENCHANTMENT_TABLE: case E_BLOCK_END_PORTAL: case E_BLOCK_END_PORTAL_FRAME: + // Notice the lack of an E_BLOCK_ENDER_CHEST here; its because ender chests can totally be pushed/pulled in MCS :) case E_BLOCK_FURNACE: case E_BLOCK_LIT_FURNACE: case E_BLOCK_HOPPER: @@ -113,6 +114,7 @@ private: case E_BLOCK_NOTE_BLOCK: case E_BLOCK_OBSIDIAN: case E_BLOCK_PISTON_EXTENSION: + case E_BLOCK_TRAPPED_CHEST: { return false; } @@ -126,24 +128,10 @@ private: return true; } - /// Returns true if the specified block can be pushed by a piston and broken / replaced - static inline bool CanBreakPush(BLOCKTYPE a_BlockType) { return cBlockInfo::IsPistonBreakable(a_BlockType); } - /// Returns true if the specified block can be pulled by a sticky piston static inline bool CanPull(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { - switch (a_BlockType) - { - case E_BLOCK_LAVA: - case E_BLOCK_STATIONARY_LAVA: - case E_BLOCK_STATIONARY_WATER: - case E_BLOCK_WATER: - { - return false; - } - } - - if (CanBreakPush(a_BlockType)) + if (cBlockInfo::IsPistonBreakable(a_BlockType)) { return false; // CanBreakPush returns true, but we need false to prevent pulling } |