summaryrefslogtreecommitdiffstats
path: root/source/Piston.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-18 23:30:34 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-18 23:30:34 +0100
commitbc1e236d547479833cc4f8d8218064cbdb9dfc0d (patch)
tree8b40bc3a6d5a7b6828d72095afc7c8dfbf5137d5 /source/Piston.cpp
parentMineshafts: silenced a compiler warning. (diff)
downloadcuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.gz
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.bz2
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.lz
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.xz
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.zst
cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.zip
Diffstat (limited to 'source/Piston.cpp')
-rw-r--r--source/Piston.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/source/Piston.cpp b/source/Piston.cpp
index 136100922..ed175d3e3 100644
--- a/source/Piston.cpp
+++ b/source/Piston.cpp
@@ -14,14 +14,8 @@
-extern bool g_BlockPistonBreakable[];
-
-
-
-
-
/// Number of ticks that the piston extending / retracting waits before setting the block
-const int PISTON_TICK_DELAY = 20;
+const int PISTON_TICK_DELAY = 6;
@@ -120,7 +114,7 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz)
AddDir(pistx, pisty, pistz, pistonMeta, -1);
// "pist" now at piston body, "ext" at future extension
- m_World->QueueSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8, PISTON_TICK_DELAY);
+ m_World->SetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8);
m_World->QueueSetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), PISTON_TICK_DELAY);
}
@@ -141,7 +135,7 @@ void cPiston::RetractPiston(int pistx, int pisty, int pistz)
m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), pistonBlock);
m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f);
- m_World->QueueSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8), PISTON_TICK_DELAY);
+ m_World->SetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8));
// Check the extension:
AddDir(pistx, pisty, pistz, pistonMeta, 1);
@@ -199,15 +193,6 @@ bool cPiston::IsSticky(BLOCKTYPE a_BlockType)
-bool cPiston::IsStickyExtension(NIBBLETYPE a_ExtMeta)
-{
- return ((a_ExtMeta & 0x08) != 0);
-}
-
-
-
-
-
bool cPiston::CanPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
switch (a_BlockType)