summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockVine.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-21 22:04:51 +0200
committerMattes D <github@xoft.cz>2014-10-21 22:04:51 +0200
commit814e4404bb428a0d825f12e513562d4e43e9e6dc (patch)
tree6916feb703428abc5d4788db2c67c47e9da10905 /src/Blocks/BlockVine.h
parentProperly exported cItemFrame and cHangingEntity to Lua. (diff)
parentReverted hook move. (diff)
downloadcuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar.gz
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar.bz2
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar.lz
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar.xz
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.tar.zst
cuberite-814e4404bb428a0d825f12e513562d4e43e9e6dc.zip
Diffstat (limited to 'src/Blocks/BlockVine.h')
-rw-r--r--src/Blocks/BlockVine.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h
index 213324cc1..ff34cdf87 100644
--- a/src/Blocks/BlockVine.h
+++ b/src/Blocks/BlockVine.h
@@ -23,10 +23,6 @@ public:
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) override
{
- UNUSED(a_Player);
- UNUSED(a_CursorX);
- UNUSED(a_CursorY);
- UNUSED(a_CursorZ);
// TODO: Disallow placement where the vine doesn't attach to something properly
BLOCKTYPE BlockType = 0;
NIBBLETYPE BlockMeta;
@@ -80,7 +76,21 @@ 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) || (a_BlockType == E_BLOCK_NEW_LEAVES) || cBlockInfo::IsSolid(a_BlockType));
+ switch (a_BlockType)
+ {
+ case E_BLOCK_GLASS:
+ case E_BLOCK_STAINED_GLASS:
+ case E_BLOCK_CHEST:
+ case E_BLOCK_TRAPPED_CHEST:
+ {
+ // You can't attach a vine to this solid blocks.
+ return false;
+ }
+ default:
+ {
+ return cBlockInfo::IsSolid(a_BlockType);
+ }
+ }
}