summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockLeaves.h
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/BlockLeaves.h
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/BlockLeaves.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/Blocks/BlockLeaves.h b/source/Blocks/BlockLeaves.h
index e8e1d0f46..76b5e6d60 100644
--- a/source/Blocks/BlockLeaves.h
+++ b/source/Blocks/BlockLeaves.h
@@ -28,8 +28,8 @@ class cBlockLeavesHandler :
public cBlockHandler
{
public:
- cBlockLeavesHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
+ cBlockLeavesHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
{
}
@@ -53,33 +53,33 @@ public:
}
- void OnDestroyed(cWorld * a_World, int a_X, int a_Y, int a_Z) override
+ void OnDestroyed(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- cBlockHandler::OnDestroyed(a_World, a_X, a_Y, a_Z);
+ cBlockHandler::OnDestroyed(a_World, a_BlockX, a_BlockY, a_BlockZ);
//0.5% chance of dropping an apple
- NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
+ NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
//check if Oak (0x1 and 0x2 bit not set)
MTRand rand;
if(!(Meta & 3) && rand.randInt(200) == 100)
{
cItems Drops;
Drops.push_back(cItem(E_ITEM_RED_APPLE, 1, 0));
- a_World->SpawnItemPickups(Drops, a_X, a_Y, a_Z);
+ a_World->SpawnItemPickups(Drops, a_BlockX, a_BlockY, a_BlockZ);
}
}
- virtual void OnNeighborChanged(cWorld * a_World, int a_X, int a_Y, int a_Z) override
+ virtual void OnNeighborChanged(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
- a_World->SetBlockMeta(a_X, a_Y, a_Z, Meta & 0x7); // Unset 0x8 bit so it gets checked for decay
+ NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
+ a_World->SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7); // Unset 0x8 bit so it gets checked for decay
}
- virtual void OnUpdate(cWorld * a_World, int a_X, int a_Y, int a_Z) override
+ virtual void OnUpdate(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
+ NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
if ((Meta & 0x04) != 0)
{
// Player-placed leaves, don't decay
@@ -96,9 +96,9 @@ public:
cBlockArea Area;
if (!Area.Read(
a_World,
- a_X - LEAVES_CHECK_DISTANCE, a_X + LEAVES_CHECK_DISTANCE,
- a_Y - LEAVES_CHECK_DISTANCE, a_Y + LEAVES_CHECK_DISTANCE,
- a_Z - LEAVES_CHECK_DISTANCE, a_Z + LEAVES_CHECK_DISTANCE,
+ a_BlockX - LEAVES_CHECK_DISTANCE, a_BlockX + LEAVES_CHECK_DISTANCE,
+ a_BlockY - LEAVES_CHECK_DISTANCE, a_BlockY + LEAVES_CHECK_DISTANCE,
+ a_BlockZ - LEAVES_CHECK_DISTANCE, a_BlockZ + LEAVES_CHECK_DISTANCE,
cBlockArea::baTypes)
)
{
@@ -106,16 +106,16 @@ public:
return;
}
- if (HasNearLog(Area, a_X, a_Y, a_Z))
+ if (HasNearLog(Area, a_BlockX, a_BlockY, a_BlockZ))
{
// Wood found, the leaves stay; mark them as checked:
- a_World->SetBlockMeta(a_X, a_Y, a_Z, Meta | 0x8);
+ a_World->SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta | 0x8);
return;
}
// Decay the leaves:
- DropBlock(a_World, a_X, a_Y, a_Z);
+ DropBlock(a_World, a_BlockX, a_BlockY, a_BlockZ);
- a_World->DigBlock(a_X, a_Y, a_Z);
+ a_World->DigBlock(a_BlockX, a_BlockY, a_BlockZ);
}