diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-03 10:52:11 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-03 10:52:11 +0200 |
commit | ea2ed2c918bddf773bb8d10298016f4e5309d0b2 (patch) | |
tree | 129848747361501cbc2e330e1a33b7f8089f51b2 /source/Blocks/BlockSugarcane.h | |
parent | sTick: Updated the plugin to work with current code (diff) | |
download | cuberite-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 'source/Blocks/BlockSugarcane.h')
-rw-r--r-- | source/Blocks/BlockSugarcane.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/Blocks/BlockSugarcane.h b/source/Blocks/BlockSugarcane.h index 28ffd8aa6..9470900f0 100644 --- a/source/Blocks/BlockSugarcane.h +++ b/source/Blocks/BlockSugarcane.h @@ -11,8 +11,8 @@ class cBlockSugarcaneHandler : public cBlockHandler
{
public:
- cBlockSugarcaneHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
+ cBlockSugarcaneHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
{
}
@@ -23,16 +23,16 @@ public: }
- virtual bool CanBeAt(cWorld * a_World, int a_X, int a_Y, int a_Z) override
+ virtual bool CanBeAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- switch (a_World->GetBlock(a_X, a_Y - 1, a_Z))
+ switch (a_World->GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ))
{
case E_BLOCK_DIRT:
case E_BLOCK_GRASS:
case E_BLOCK_FARMLAND:
case E_BLOCK_SAND:
{
- return a_World->IsBlockDirectlyWatered(a_X, a_Y - 1, a_Z);
+ return a_World->IsBlockDirectlyWatered(a_BlockX, a_BlockY - 1, a_BlockZ);
}
case E_BLOCK_SUGARCANE:
{
@@ -43,17 +43,18 @@ public: }
- void OnUpdate(cWorld * a_World, int a_X, int a_Y, int a_Z) override
+ void OnUpdate(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
- // TODO: Handle Growing here
+ a_World->GrowSugarcane(a_BlockX, a_BlockY, a_BlockZ, 1);
}
-
+
virtual bool CanBePlacedOnSide() override
{
return false;
}
+
virtual const char * GetStepSound(void) override
{
return "step.grass";
|