summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockBigFlower.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-07 21:03:21 +0100
committerGitHub <noreply@github.com>2024-11-07 21:03:21 +0100
commitab62fc398818d717b54110b13e1b3af48e07b686 (patch)
treed76804f9c594695ac3b90a00687b5398158df1f5 /src/Blocks/BlockBigFlower.h
parentAdded code to export definitions for a lua-language-server (#5475) (diff)
downloadcuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar.gz
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar.bz2
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar.lz
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar.xz
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.tar.zst
cuberite-ab62fc398818d717b54110b13e1b3af48e07b686.zip
Diffstat (limited to 'src/Blocks/BlockBigFlower.h')
-rw-r--r--src/Blocks/BlockBigFlower.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Blocks/BlockBigFlower.h b/src/Blocks/BlockBigFlower.h
index 1b2c0d735..d8270dc6c 100644
--- a/src/Blocks/BlockBigFlower.h
+++ b/src/Blocks/BlockBigFlower.h
@@ -25,9 +25,10 @@ private:
if (IsMetaTopPart(a_Meta))
{
BLOCKTYPE BottomType;
+ const auto BottomPosition = a_Position.addedY(-1);
if (
- (a_Position.y < 1) ||
- !a_World.GetBlockTypeMeta(a_Position - Vector3i(0, 1, 0), BottomType, a_Meta) ||
+ !cChunkDef::IsValidHeight(BottomPosition) ||
+ !a_World.GetBlockTypeMeta(BottomPosition, BottomType, a_Meta) ||
(BottomType != E_BLOCK_BIG_FLOWER)
)
{
@@ -104,7 +105,7 @@ private:
// Both parts can only that they're rooted in grass.
const auto RootPosition = a_Position.addedY(IsMetaTopPart(a_Meta) ? -2 : -1);
- return (RootPosition.y >= 0) && IsBlockTypeOfDirt(a_Chunk.GetBlock(RootPosition));
+ return cChunkDef::IsValidHeight(RootPosition) && IsBlockTypeOfDirt(a_Chunk.GetBlock(RootPosition));
}