diff options
author | Mattes D <github@xoft.cz> | 2014-10-15 19:01:55 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-15 19:09:09 +0200 |
commit | eeb580a74e48829908c303f8145802bfa1805c68 (patch) | |
tree | a08569e93e3b203f64237ef5fc6902821e24f83b /src/Blocks/BlockVine.h | |
parent | Usernames are lowercased before generating offline UUID. (diff) | |
download | cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.gz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.bz2 cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.lz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.xz cuberite-eeb580a74e48829908c303f8145802bfa1805c68.tar.zst cuberite-eeb580a74e48829908c303f8145802bfa1805c68.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockVine.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h index 06d84f2d4..213324cc1 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVine.h @@ -166,23 +166,31 @@ public: return false; } + virtual void OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) { UNUSED(a_ChunkInterface); UNUSED(a_WorldInterface); - UNUSED(a_BlockPluginInterface); + // Vine cannot grow down if at the bottom: + if (a_RelY < 1) + { + return; + } + + // Grow one block down, if possible: BLOCKTYPE Block; a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY - 1, a_RelZ, Block); if (Block == E_BLOCK_AIR) { - if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread((cWorld*) &a_WorldInterface, a_RelX + a_Chunk.GetPosX() * cChunkDef::Width, a_RelY - 1, a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width, ssVineSpread)) + if (!a_BlockPluginInterface.CallHookBlockSpread(a_RelX + a_Chunk.GetPosX() * cChunkDef::Width, a_RelY - 1, a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width, ssVineSpread)) { a_Chunk.UnboundedRelSetBlock(a_RelX, a_RelY - 1, a_RelZ, E_BLOCK_VINES, a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ)); } } } + virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override { return ((a_Meta >> 1) | (a_Meta << 3)) & 0x0f; // Rotate bits to the right |