From aeabf0f82e299a0535265961e06b6fdab09aac36 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 20 Aug 2013 20:15:21 +0100 Subject: Updated block transparencies Now includes activator rails and piston extensions --- source/BlockID.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/BlockID.cpp b/source/BlockID.cpp index 0345614c5..40664647a 100644 --- a/source/BlockID.cpp +++ b/source/BlockID.cpp @@ -584,6 +584,7 @@ public: // Transparent blocks g_BlockTransparent[E_BLOCK_AIR] = true; + g_BlockTransparent[E_BLOCK_ACTIVATOR_RAIL] = true; g_BlockTransparent[E_BLOCK_BROWN_MUSHROOM] = true; g_BlockTransparent[E_BLOCK_CARROTS] = true; g_BlockTransparent[E_BLOCK_CHEST] = true; @@ -603,6 +604,7 @@ public: g_BlockTransparent[E_BLOCK_NETHER_BRICK_FENCE] = true; g_BlockTransparent[E_BLOCK_POTATOES] = true; g_BlockTransparent[E_BLOCK_POWERED_RAIL] = true; + g_BlockTransparent[E_BLOCK_PISTON_EXTENSION] = true; g_BlockTransparent[E_BLOCK_PUMPKIN_STEM] = true; g_BlockTransparent[E_BLOCK_RAIL] = true; g_BlockTransparent[E_BLOCK_RED_MUSHROOM] = true; -- cgit v1.2.3 From 148d4e9b8086f687387c8b28df1c89ed2cf69271 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 20 Aug 2013 20:15:46 +0100 Subject: Activator rail now uses rail handler --- source/Blocks/BlockHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp index cbca5a4ec..6584eeed4 100644 --- a/source/Blocks/BlockHandler.cpp +++ b/source/Blocks/BlockHandler.cpp @@ -96,6 +96,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) switch(a_BlockType) { // Block handlers, alphabetically sorted: + case E_BLOCK_ACTIVATOR_RAIL: return new cBlockRailHandler (a_BlockType); case E_BLOCK_BED: return new cBlockBedHandler (a_BlockType); case E_BLOCK_BIRCH_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_BREWING_STAND: return new cBlockBrewingStandHandler (a_BlockType); -- cgit v1.2.3 From f626b8c8647b77819bf526d8ae312baded2cb017 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 20 Aug 2013 20:17:35 +0100 Subject: Juggled piston code to prioritise block action This improves animation chance without long delays. Additionally, queued a previously unqueued base set. --- source/Piston.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Piston.cpp b/source/Piston.cpp index 97db3e568..f4244d177 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -76,6 +76,9 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz) // Already extended, bail out return; } + + m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, pistonBlock); + m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); int dist = FirstPassthroughBlock(pistx, pisty, pistz, pistonMeta); if (dist < 0) @@ -117,9 +120,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->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, pistonBlock); - m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); - m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); + m_World->QueueSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8, PISTON_TICK_DELAY); m_World->QueueSetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), PISTON_TICK_DELAY); } @@ -139,10 +140,9 @@ 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->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); - // Check the extension: AddDir(pistx, pisty, pistz, pistonMeta, 1); if (m_World->GetBlock(pistx, pisty, pistz) != E_BLOCK_PISTON_EXTENSION) -- cgit v1.2.3