summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2022-04-19 01:05:51 +0200
committerGitHub <noreply@github.com>2022-04-19 01:05:51 +0200
commit900f95c42b9b6ff333cc60640c17fb197025e280 (patch)
tree4fc6e32ab97d8b5ed8c8de91526b9e98e32cdc72 /src/Blocks/BlockPiston.cpp
parentChanging Copyright Years (happy 11) (diff)
downloadcuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar.gz
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar.bz2
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar.lz
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar.xz
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.tar.zst
cuberite-900f95c42b9b6ff333cc60640c17fb197025e280.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockPiston.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index 31f15a467..afed8bae0 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -215,6 +215,12 @@ bool cBlockPistonHandler::CanPushBlock(
Vector3iSet & a_BlocksPushed, const Vector3i & a_PushDir
)
{
+ if (!cChunkDef::IsValidHeight(a_BlockPos.y))
+ {
+ // Can't push a void block.
+ return false;
+ }
+
const static std::array<Vector3i, 6> pushingDirs =
{
{
@@ -228,11 +234,6 @@ bool cBlockPistonHandler::CanPushBlock(
NIBBLETYPE currMeta;
a_World.GetBlockTypeMeta(a_BlockPos, currBlock, currMeta);
- if (!cChunkDef::IsValidHeight(a_BlockPos.y))
- {
- return !a_RequirePushable;
- }
-
if (currBlock == E_BLOCK_AIR)
{
// Air can be pushed