diff options
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockPiston.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp index 20863cdf3..ee8620308 100644 --- a/src/Blocks/BlockPiston.cpp +++ b/src/Blocks/BlockPiston.cpp @@ -48,7 +48,7 @@ void cBlockPistonHandler::ExtendPiston(Vector3i a_BlockPos, cWorld & a_World) BLOCKTYPE pistonBlock; NIBBLETYPE pistonMeta; - a_World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta); + a_World.GetBlockTypeMeta(a_BlockPos, pistonBlock, pistonMeta); a_World.BroadcastBlockAction(a_BlockPos, PistonExtendAction, pistonMeta, pistonBlock); } @@ -60,7 +60,7 @@ void cBlockPistonHandler::ExtendPiston(Vector3i a_BlockPos, cWorld & a_World) { BLOCKTYPE pistonBlock; NIBBLETYPE pistonMeta; - World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta); + World.GetBlockTypeMeta(a_BlockPos, pistonBlock, pistonMeta); if ((pistonBlock != E_BLOCK_PISTON) && !IsSticky(pistonBlock)) { @@ -86,11 +86,8 @@ void cBlockPistonHandler::ExtendPiston(Vector3i a_BlockPos, cWorld & a_World) // Set the extension and the piston base correctly Vector3i extensionPos = a_BlockPos + pushDir; - World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta | 0x8); - World.SetBlock( - extensionPos.x, extensionPos.y, extensionPos.z, - E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0) - ); + World.SetBlock(a_BlockPos, pistonBlock, pistonMeta | 0x8); + World.SetBlock(extensionPos, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0)); // Play sound effect only if extended successfully World.BroadcastSoundEffect("block.piston.extend", a_BlockPos, 0.5f, 0.7f); @@ -107,7 +104,7 @@ void cBlockPistonHandler::RetractPiston(Vector3i a_BlockPos, cWorld & a_World) { BLOCKTYPE pistonBlock; NIBBLETYPE pistonMeta; - a_World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta); + a_World.GetBlockTypeMeta(a_BlockPos, pistonBlock, pistonMeta); a_World.BroadcastBlockAction(a_BlockPos, PistonRetractAction, pistonMeta, pistonBlock); } @@ -115,7 +112,7 @@ void cBlockPistonHandler::RetractPiston(Vector3i a_BlockPos, cWorld & a_World) { BLOCKTYPE pistonBlock; NIBBLETYPE pistonMeta; - World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta); + World.GetBlockTypeMeta(a_BlockPos, pistonBlock, pistonMeta); if ((pistonBlock != E_BLOCK_PISTON) && !IsSticky(pistonBlock)) { @@ -192,7 +189,7 @@ void cBlockPistonHandler::PushBlocks( NIBBLETYPE moveMeta; for (auto & moveBlockPos : sortedBlocks) { - a_World.GetBlockTypeMeta(moveBlockPos.x, moveBlockPos.y, moveBlockPos.z, moveBlock, moveMeta); + a_World.GetBlockTypeMeta(moveBlockPos, moveBlock, moveMeta); if (cBlockInfo::IsPistonBreakable(moveBlock)) { @@ -202,9 +199,9 @@ void cBlockPistonHandler::PushBlocks( else { // Not breakable, just move it - a_World.SetBlock(moveBlockPos.x, moveBlockPos.y, moveBlockPos.z, E_BLOCK_AIR, 0); + a_World.SetBlock(moveBlockPos, E_BLOCK_AIR, 0); moveBlockPos += a_PushDir; - a_World.SetBlock(moveBlockPos.x, moveBlockPos.y, moveBlockPos.z, moveBlock, moveMeta); + a_World.SetBlock(moveBlockPos, moveBlock, moveMeta); } } } @@ -229,7 +226,7 @@ bool cBlockPistonHandler::CanPushBlock( BLOCKTYPE currBlock; NIBBLETYPE currMeta; - a_World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, currBlock, currMeta); + a_World.GetBlockTypeMeta(a_BlockPos, currBlock, currMeta); if (!cChunkDef::IsValidHeight(a_BlockPos.y)) { |