From 679085b520f32e898a88823b1c2d23a12a1764f1 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 18 Aug 2013 00:33:14 +0100 Subject: Bugfix Update [SEE DESC} Added stained clay, coal block, and hardened clay Block IDs Added stained clay and carpet block Metas Fixed bug with sticky retract bailing out but not unsetting arm Fixed autocomplete not working when not at the first character, fixes #64 Added furnace recipes for hardened clay and coal and coal blocks --- source/Piston.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/Piston.cpp') diff --git a/source/Piston.cpp b/source/Piston.cpp index 7ffa9febd..058f92a0e 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -173,6 +173,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) ) { // These cannot be moved by the sticky piston, bail out + m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); return; } -- cgit v1.2.3 From 8a3174164b0ee3e902031d631c690ed555b74f05 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 18 Aug 2013 14:52:38 +0100 Subject: Properly fixed piston non-animation Fixes #57 --- source/Piston.cpp | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'source/Piston.cpp') diff --git a/source/Piston.cpp b/source/Piston.cpp index 058f92a0e..4c8d56261 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -114,7 +114,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) { AddDir(pistx, pisty, pistz, pistonMeta & 7, -1) //Move one set of coords one back from breakable dropped block m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currBlockMeta); //Get the block - m_World->SetBlock( oldx, oldy, oldz, currBlock, currBlockMeta); //Set the block at the location of the original coords + m_World->SetServerBlock( oldx, oldy, oldz, currBlock, currBlockMeta); //Set the block at the location of the original coords oldx = pistx; //Shift the selectors down a block and repeat oldy = pisty; oldz = pistz; @@ -126,10 +126,19 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) int extz = pistz; AddDir(pistx, pisty, pistz, pistonMeta & 7, -1) //Move back one block to the piston base - m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, E_BLOCK_PISTON); //Set the base + + if (pistonBlock == E_BLOCK_STICKY_PISTON) + { + m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, E_BLOCK_STICKY_PISTON); + } + else + { + m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, E_BLOCK_PISTON); + } + 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->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta); //Set the arm + m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); //Set the base + m_World->SetServerBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta); //Set the arm } @@ -146,9 +155,18 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) // Already retracted, bail out return; } - m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), E_BLOCK_PISTON); + + if (pistonBlock == E_BLOCK_STICKY_PISTON) + { + m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), E_BLOCK_STICKY_PISTON); + } + else + { + m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), E_BLOCK_PISTON); + } + m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); - m_World->FastSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); //Set the base + m_World->SetServerBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); //Set the base AddDir(pistx, pisty, pistz, pistonMeta & 7, 1) //Move forwards to the extension coord if (m_World->GetBlock(pistx, pisty, pistz) != E_BLOCK_PISTON_EXTENSION) @@ -173,17 +191,16 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) ) { // These cannot be moved by the sticky piston, bail out - m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); + m_World->SetServerBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); return; } - m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta); - m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0); + m_World->SetServerBlock(pistx, pisty, pistz, tempblock, tempmeta); + m_World->SetServerBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0); } else { - - m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); + m_World->SetServerBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); } } -- cgit v1.2.3 From fbbf12f3a6b1dd28f020b08ae73b075c60983a67 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 18 Aug 2013 15:04:38 +0100 Subject: Added checks to bail out if block entities are being pushed by a piston --- source/Piston.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source/Piston.cpp') diff --git a/source/Piston.cpp b/source/Piston.cpp index 4c8d56261..f83eb016d 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -62,7 +62,18 @@ unsigned short cPiston::FirstPassthroughBlock(int pistonX, int pistonY, int pist { AddDir( pistonX, pistonY, pistonZ, pistonmeta, 1) //Set the coords one further from the piston direction m_World->GetBlockTypeMeta(pistonX, pistonY, pistonZ, currBlock, currMeta); - if ((currBlock == E_BLOCK_BEDROCK) || (currBlock == E_BLOCK_OBSIDIAN) || (currBlock == E_BLOCK_PISTON_EXTENSION) || ( (currMeta & 0x8) != 0x0 )) + if ((currBlock == E_BLOCK_BEDROCK) || + (currBlock == E_BLOCK_OBSIDIAN) || + (currBlock == E_BLOCK_PISTON_EXTENSION) || + ( (currMeta & 0x8) != 0x0 ) || //Seems to include signs as well + (currBlock == E_BLOCK_CHEST) || + (currBlock == E_BLOCK_DISPENSER) || + (currBlock == E_BLOCK_DROPPER) || + (currBlock == E_BLOCK_FURNACE) || + (currBlock == E_BLOCK_LIT_FURNACE) || + (currBlock == E_BLOCK_HOPPER) || + (currBlock == E_BLOCK_JUKEBOX) || + (currBlock == E_BLOCK_NOTE_BLOCK)) { return 9001; } @@ -187,7 +198,15 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) (tempblock == E_BLOCK_BEDROCK) || (tempblock == E_BLOCK_PISTON_EXTENSION) || (g_BlockPistonBreakable[tempblock]) || - ((tempmeta & 0x8) != 0x0 ) + ( (tempmeta & 0x8) != 0x0 ) || //Seems to include signs as well + (tempblock == E_BLOCK_CHEST) || + (tempblock == E_BLOCK_DISPENSER) || + (tempblock == E_BLOCK_DROPPER) || + (tempblock == E_BLOCK_FURNACE) || + (tempblock == E_BLOCK_LIT_FURNACE) || + (tempblock == E_BLOCK_HOPPER) || + (tempblock == E_BLOCK_JUKEBOX) || + (tempblock == E_BLOCK_NOTE_BLOCK) ) { // These cannot be moved by the sticky piston, bail out -- cgit v1.2.3