summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-03 10:52:11 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-03 10:52:11 +0200
commitea2ed2c918bddf773bb8d10298016f4e5309d0b2 (patch)
tree129848747361501cbc2e330e1a33b7f8089f51b2 /source/Blocks/BlockPiston.cpp
parentsTick: Updated the plugin to work with current code (diff)
downloadcuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar.gz
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar.bz2
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar.lz
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar.xz
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.tar.zst
cuberite-ea2ed2c918bddf773bb8d10298016f4e5309d0b2.zip
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockPiston.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/source/Blocks/BlockPiston.cpp b/source/Blocks/BlockPiston.cpp
index a4ed13d88..e20f5c600 100644
--- a/source/Blocks/BlockPiston.cpp
+++ b/source/Blocks/BlockPiston.cpp
@@ -15,23 +15,30 @@
-cBlockPistonHandler::cBlockPistonHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
+cBlockPistonHandler::cBlockPistonHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
{
}
-void cBlockPistonHandler::OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir)
-{
+
+
+
+void cBlockPistonHandler::OnPlaced(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, int a_Dir)
+{
}
-void cBlockPistonHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
+
+
+
+
+void cBlockPistonHandler::OnDestroyed(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
{
- char OldMeta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
+ char OldMeta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- int newX = a_X;
- int newY = a_Y;
- int newZ = a_Z;
+ int newX = a_BlockX;
+ int newY = a_BlockY;
+ int newZ = a_BlockZ;
AddPistonDir(newX, newY, newZ, OldMeta & ~(8), 1);
if (a_World->GetBlock(newX, newY, newZ) == E_BLOCK_PISTON_EXTENSION)
@@ -40,12 +47,20 @@ void cBlockPistonHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z
}
}
-void cBlockPistonHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+
+
+
+
+void cBlockPistonHandler::PlaceBlock(cWorld * a_World, cPlayer * a_Player, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir)
{
- a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), a_Player->GetPitch()));
- OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
+ a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), a_Player->GetPitch()));
+ OnPlacedByPlayer(a_World, a_Player, a_BlockX, a_BlockY, a_BlockZ, a_Dir);
cRedstone Redstone(a_World);
- Redstone.ChangeRedstone(a_X, a_Y, a_Z, false);
-} \ No newline at end of file
+ Redstone.ChangeRedstone(a_BlockX, a_BlockY, a_BlockZ, false);
+}
+
+
+
+