summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockVine.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-02 15:05:55 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-02 15:05:55 +0200
commitdcaea749ae502366c23f2c04f3b42882cb71d0d6 (patch)
tree56e499098895a03bc66beac5aa33ba4ee261f17e /src/Blocks/BlockVine.h
parentMerge branch 'master' into globals (diff)
parentMerge pull request #831 from mc-server/Wither (diff)
downloadcuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.gz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.bz2
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.lz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.xz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.zst
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.zip
Diffstat (limited to 'src/Blocks/BlockVine.h')
-rw-r--r--src/Blocks/BlockVine.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h
index 708583e70..7bb9dc484 100644
--- a/src/Blocks/BlockVine.h
+++ b/src/Blocks/BlockVine.h
@@ -1,7 +1,7 @@
#pragma once
#include "BlockHandler.h"
-#include "MetaRotater.h"
+#include "MetaRotator.h"
@@ -73,7 +73,7 @@ public:
/// Returns true if the specified block type is good for vines to attach to
static bool IsBlockAttachable(BLOCKTYPE a_BlockType)
{
- return (a_BlockType == E_BLOCK_LEAVES) || cBlockInfo::IsSolid(a_BlockType);
+ return (a_BlockType == E_BLOCK_LEAVES) || (a_BlockType == E_BLOCK_NEW_LEAVES) || cBlockInfo::IsSolid(a_BlockType);
}
@@ -83,7 +83,7 @@ public:
static const struct
{
int x, z;
- int Bit;
+ NIBBLETYPE Bit;
} Coords[] =
{
{ 0, 1, 1}, // south, ZP
@@ -91,7 +91,7 @@ public:
{ 0, -1, 4}, // north, ZM
{ 1, 0, 8}, // east, XP
} ;
- int res = 0;
+ NIBBLETYPE res = 0;
for (size_t i = 0; i < ARRAYCOUNT(Coords); i++)
{
BLOCKTYPE BlockType;
@@ -175,7 +175,10 @@ public:
a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY - 1, a_RelZ, Block);
if (Block == E_BLOCK_AIR)
{
- a_Chunk.UnboundedRelSetBlock(a_RelX, a_RelY - 1, a_RelZ, E_BLOCK_VINES, a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ));
+ if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread((cWorld*) &a_WorldInterface, a_RelX * cChunkDef::Width, a_RelY - 1, a_RelZ * 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));
+ }
}
}
@@ -194,14 +197,14 @@ public:
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
{
// Bits 2 and 4 stay, bits 1 and 3 swap
- return ((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2));
+ return (NIBBLETYPE)((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2));
}
virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
{
// Bits 1 and 3 stay, bits 2 and 4 swap
- return ((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2));
+ return (NIBBLETYPE)((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2));
}
} ;